MetroSave

Add Save button to Metrolyrics site

目前為 2017-03-13 提交的版本,檢視 最新版本

作者
Zart
評價
0 0 0
版本
2.0
建立日期
2017-03-13
更新日期
2017-03-13
尺寸
2.5 KB
授權條款
未知
腳本執行於

Supports desktop and mobile versions. You can also use downloader as bookmarklet: javascript:var r=document.querySelectorAll('.verse,.writers:not(:last-child),.lyric-source>*:not(:nth-last-child(-n+2))');for(var i=0,s=[];i<r.length;i++){for(var j=0;j<r[i].childNodes.length;s.push(r[i].childNodes[j++].textContent));if(r[i].tagName=='P')s.push('\n\n');else s.push('\n');} s=s.join('\n').replace(/\n{2,3}/g,'\n').replace(/\n/gm,'\r\n'); var a=document.createElement('A');a.target='void';a.download=ml.lyricName+'.txt';var unsafe=/[^\0-\x7f\xa9]/,BOM='\ufeff';if(unsafe.test(s))a.href=encodeURI('data:text/plain;utf8,'+BOM+s);else a.href='data:text/plain;quoted-printable,'+escape(s);a.click(); In mobile browsers (where bookmarklets disabled) you can copy all except first "j", enter "j" in address bar, "Paste", "Enter" avascript:var r=document.querySelectorAll('.verse,.writers:not(:last-child),.lyric-source>*:not(:nth-last-child(-n+2))');for(var i=0,s=[];i<r.length;i++){for(var j=0;j<r[i].childNodes.length;s.push(r[i].childNodes[j++].textContent));if(r[i].tagName=='P')s.push('\n\n');else s.push('\n');} s=s.join('\n').replace(/\n{2,3}/g,'\n').replace(/\n/gm,'\r\n'); var a=document.createElement('A');a.target='void';a.download=ml.lyricName+'.txt';var unsafe=/[^\0-\x7f\xa9]/,BOM='\ufeff';if(unsafe.test(s))a.href=encodeURI('data:text/plain;utf8,'+BOM+s);else a.href='data:text/plain;quoted-printable,'+escape(s);a.click();