Difference between revisions of "User:One-Six/fullpagename.js"
m |
m (change to function) |
||
Line 1: | Line 1: | ||
− | let | + | const hrefFullPageNamee = () => { |
− | if(/index\.php/g.test( | + | let fullPageNamee = window.location.href.replace(/http(s|):\/\/en.moegirl.org\//,""); |
− | + | if(/index\.php/g.test(fullPageNamee)) { | |
− | + | let array = [...fullPageNamee.matchAll(/title=(.+?)(?:&|$)/g)]; | |
− | } | + | fullPageNamee = array[array.length - 1][1]; |
− | + | } | |
− | + | return fullPageNamee.replace(/#.+$/,""); | |
− | + | //console.log("FULLPAGENAME:"+fullPageNamee); | |
− | console.log("FULLPAGENAME:"+ | + | }; |
Revision as of 04:21, 28 June 2020
const hrefFullPageNamee = () => { let fullPageNamee = window.location.href.replace(/http(s|):\/\/en.moegirl.org\//,""); if(/index\.php/g.test(fullPageNamee)) { let array = [...fullPageNamee.matchAll(/title=(.+?)(?:&|$)/g)]; fullPageNamee = array[array.length - 1][1]; } return fullPageNamee.replace(/#.+$/,""); //console.log("FULLPAGENAME:"+fullPageNamee); };