File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88// @namespace http://tampermonkey.net/
99// @require https://cdn.jsdelivr.net/jquery/1.7.2/jquery.min.js
1010// @require https://cdn.jsdelivr.net/hi-base64/0.2.0/base64.min.js
11- // @version 1.3.16
11+ // @version 1.3.17
1212// @author Hoothin
1313// @mail rixixi@gmail.com
1414// @include http*://*/*
698698
699699 function checkSel ( e ) {
700700 var sel = document . getSelection ( ) ;
701- var link = sel . toString ( ) ;
702- if ( link === "" ) {
701+ var link = sel . toString ( ) , validReg = / ^ ( m a g n e t : \? x t = u r n : b t i h : | e d 2 k : \/ \/ \| f i l e | h t t p s ? : | f t p : ) / i ;
702+ if ( link === "" || ! validReg . test ( link ) ) {
703703 if ( targetA ) link = targetA . href ;
704704 else link = prompt ( "输入需要离线下载的链接:" , "magnet:?xt=urn:btih:" ) ;
705705 } /*else{
708708 link=focusedElement.href;
709709 }
710710 }*/
711- if ( / ^ ( m a g n e t | e d 2 k : \/ \/ \| f i l e | h t t p s ? : | f t p : ) / . test ( link ) ) {
711+ if ( validReg . test ( link ) ) {
712712 init ( ) ;
713713 showDiskIcons ( getRightUrl ( link ) , mouseEve . pageY - 10 , mouseEve . pageX - 10 ) ;
714714 }
You can’t perform that action at this time.
0 commit comments