|
7 | 7 | // @description:zh-TW 一鍵自動將磁鏈、bt種子或其他下載資源離綫下載至網槃 |
8 | 8 | // @namespace http://tampermonkey.net/ |
9 | 9 | // @require http://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js |
10 | | -// @version 1.0.40 |
| 10 | +// @version 1.0.41 |
11 | 11 | // @author Hoothin |
12 | 12 | // @mail rixixi@gmail.com |
13 | 13 | // @include http*://*/* |
|
137 | 137 | } |
138 | 138 |
|
139 | 139 | function getAllEnableUrl() { |
140 | | - if(GM_getValue('eoDisable_'+location.href))return; |
| 140 | + if(GM_getValue('eoDisable_'+document.domain))return; |
141 | 141 | var parentDiv=$("<div style='display:none;position:relative;z-index:99999;overflow:visible;text-align:left;'></div>"); |
142 | | - var rawnodes = $(enableUrl).get(); |
| 142 | + var rawnodes = $(enableUrl).get(),customnodes=[]; |
143 | 143 | var nodes = []; |
144 | 144 | var i,x; |
145 | 145 | var curNode; |
|
152 | 152 | for(var reg of regs){ |
153 | 153 | var patt=new RegExp(reg); |
154 | 154 | if(patt.test(aTag.href) && $.inArray(aTag, rawnodes)==-1){ |
155 | | - rawnodes.push(aTag); |
| 155 | + customnodes.push(aTag); |
156 | 156 | break; |
157 | 157 | } |
158 | 158 | } |
|
216 | 216 | } |
217 | 217 | } |
218 | 218 | } |
| 219 | + if(customnodes.length > 0){ |
| 220 | + for (i = 0; i < customnodes.length; i++) { |
| 221 | + curNode = customnodes[i]; |
| 222 | + if(!include(nodes,curNode)){ |
| 223 | + nodes.push(curNode); |
| 224 | + } |
| 225 | + } |
| 226 | + } |
219 | 227 |
|
220 | 228 | if(nodes.length > 0){ |
221 | 229 | $("body").append(parentDiv); |
|
409 | 417 | }, 500); |
410 | 418 | GM_deleteValue('eoUrl'); |
411 | 419 | } |
412 | | - }else if(i > 6 || ((i++) === 0 && $(enableUrl).length > 0)){ |
| 420 | + }else if(i > 2 || ((i++) === 0 && $(enableUrl).length > 0)){ |
413 | 421 | window.clearInterval(t); |
414 | 422 | getAllEnableUrl(); |
415 | 423 | } |
|
419 | 427 | } |
420 | 428 | function toggleIcon(){ |
421 | 429 | $('.whx-a').toggle(500); |
422 | | - if(GM_getValue('eoDisable_'+location.href)){ |
423 | | - GM_deleteValue('eoDisable_'+location.href); |
| 430 | + if(GM_getValue('eoDisable_'+document.domain)){ |
| 431 | + GM_deleteValue('eoDisable_'+document.domain); |
424 | 432 | if($('.whx-a').length<1)getAllEnableUrl(); |
425 | 433 | }else{ |
426 | | - GM_setValue('eoDisable_'+location.href,true); |
| 434 | + GM_setValue('eoDisable_'+document.domain,true); |
427 | 435 | } |
428 | 436 | } |
429 | 437 | GM_registerMenuCommand(i18n.toggle, toggleIcon); |
|
0 commit comments