diff --git a/src/html/before-navigate.js b/src/html/before-navigate.js index a840f511e..caa05cfdc 100644 --- a/src/html/before-navigate.js +++ b/src/html/before-navigate.js @@ -1,38 +1,38 @@ -const args=new URLSearchParams(location.search) -if(args.has("target")) -{ - let span=document.querySelector("[data-message='beforeNavigateDestination']") - span.innerHTML=span.innerHTML.replace("%",'') - const a=span.querySelector("a"),referer=args.get("referer") - a.textContent=args.get("target") - const when_safe=()=>{ - document.getElementById("unsafe").classList.add("uk-hidden") - a.href=referer&&referer!="tracker"?"https://universal-bypass.org/navigate"+location.search:args.get("target") - brws.storage.sync.get(["navigation_delay","no_instant_navigation_trackers"],res=>{ - if(res.navigation_delay==0||(referer=="tracker"&&res.no_instant_navigation_trackers!=="true")) - { - document.querySelector("div").innerHTML="

" - document.querySelector("p").textContent=brws.i18n.getMessage("beforeNavigateInstant").replace("%",args.get("target")) - setTimeout(()=>location.href=a.href,10) - } - else - { - timer("beforeNavigateTimer",res.navigation_delay,true,()=>location.href=a.href) - } - }) - } - if(args.has("safe_in")) - { - document.getElementById("unsafe").classList.remove("uk-hidden") - document.getElementById("options-link").classList.add("uk-hidden") - timer("beforeNavigateUnsafeTimer",args.get("safe_in"),false,when_safe) - } - else - { - when_safe() - } -} -else -{ - history.back() -} +const args=new URLSearchParams(location.search) +if(args.has("target")) +{ + let span=document.querySelector("[data-message='beforeNavigateDestination']") + span.innerHTML=span.innerHTML.replace("%",'') + const a=span.querySelector("a"),referer=args.get("referer") + a.textContent=args.get("target") + const when_safe=()=>{ + document.getElementById("unsafe").classList.add("uk-hidden") + a.href=referer&&referer!="tracker"?"https://fastforward.team/navigate"+location.search:args.get("target") + brws.storage.sync.get(["navigation_delay","no_instant_navigation_trackers"],res=>{ + if(res.navigation_delay==0||(referer=="tracker"&&res.no_instant_navigation_trackers!=="true")) + { + document.querySelector("div").innerHTML="

" + document.querySelector("p").textContent=brws.i18n.getMessage("beforeNavigateInstant").replace("%",args.get("target")) + setTimeout(()=>location.href=a.href,10) + } + else + { + timer("beforeNavigateTimer",res.navigation_delay,true,()=>location.href=a.href) + } + }) + } + if(args.has("safe_in")) + { + document.getElementById("unsafe").classList.remove("uk-hidden") + document.getElementById("options-link").classList.add("uk-hidden") + timer("beforeNavigateUnsafeTimer",args.get("safe_in"),false,when_safe) + } + else + { + when_safe() + } +} +else +{ + history.back() +} diff --git a/src/html/crowd-bypassed.js b/src/html/crowd-bypassed.js index 1f163d67a..fa3cdc33e 100644 --- a/src/html/crowd-bypassed.js +++ b/src/html/crowd-bypassed.js @@ -1,28 +1,28 @@ -const args=new URLSearchParams(location.search) -if(args.has("target")&&args.has("referer")) -{ - let span=document.querySelector('[data-message="crowdBypassedInfo"]'),opentimer - span.innerHTML=span.innerHTML.replace("%",'') - const a=span.querySelector("a"), - closetimer=()=>brws.storage.sync.get(["crowd_close_delay"],res=>timer("crowdCloseTimer",res.crowd_close_delay,true,()=>{ - brws.runtime.sendMessage({type: "close-tab"}) - })) - a.textContent=args.get("target") - a.href=args.has("referer")?"https://universal-bypass.org/navigate"+location.search:args.get("target") - a.onclick=()=>{ - clearInterval(opentimer) - closetimer() - } - document.getElementById("ignore").href=args.get("referer")+"#ignoreCrowdBypass" - brws.storage.sync.get(["crowd_open_delay"],res=>opentimer=timer("crowdBypassedTimer",res.crowd_open_delay,true,()=>{ - brws.runtime.sendMessage({ - type: "open-tab", - url: a.href - }) - closetimer() - })) -} -else -{ - history.back() -} +const args=new URLSearchParams(location.search) +if(args.has("target")&&args.has("referer")) +{ + let span=document.querySelector('[data-message="crowdBypassedInfo"]'),opentimer + span.innerHTML=span.innerHTML.replace("%",'') + const a=span.querySelector("a"), + closetimer=()=>brws.storage.sync.get(["crowd_close_delay"],res=>timer("crowdCloseTimer",res.crowd_close_delay,true,()=>{ + brws.runtime.sendMessage({type: "close-tab"}) + })) + a.textContent=args.get("target") + a.href=args.has("referer")?"https://fastforward.team/navigate"+location.search:args.get("target") + a.onclick=()=>{ + clearInterval(opentimer) + closetimer() + } + document.getElementById("ignore").href=args.get("referer")+"#ignoreCrowdBypass" + brws.storage.sync.get(["crowd_open_delay"],res=>opentimer=timer("crowdBypassedTimer",res.crowd_open_delay,true,()=>{ + brws.runtime.sendMessage({ + type: "open-tab", + url: a.href + }) + closetimer() + })) +} +else +{ + history.back() +} diff --git a/src/js/background.js b/src/js/background.js index d9072d029..bf5dc2835 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -317,9 +317,9 @@ refreshInjectionScript = () => { if(enabled) { injectionScript = (upstreamInjectionScript + "\n" + userScript) - .split("UNIVERSAL_BYPASS_INTERNAL_VERSION").join("10") - .split("UNIVERSAL_BYPASS_EXTERNAL_VERSION").join(extension_version) - .split("UNIVERSAL_BYPASS_INJECTION_VERSION").join(upstreamCommit?upstreamCommit.substr(0,7):"dev") + .split("FAST_FORWARD_INTERNAL_VERSION").join("10") + .split("FAST_FORWARD_EXTERNAL_VERSION").join(extension_version) + .split("FAST_FORWARD_INJECTION_VERSION").join(upstreamCommit?upstreamCommit.substr(0,7):"dev") Object.keys(preflightRules).forEach(name=>{ if(name in onBeforeRequest_rules) { @@ -479,16 +479,16 @@ brws.webRequest.onBeforeRequest.addListener(details=>{ safe_in=arr[1] } return encodedRedirect(url,decodeURIComponent(arr[0]),safe_in) -},{types:["main_frame"],urls:["*://universal-bypass.org/bypassed?target=*&referer=*"]},["blocking"]) +},{types:["main_frame"],urls:["*://fastforward.team/bypassed?target=*&referer=*"]},["blocking"]) brws.webRequest.onBeforeRequest.addListener(details=>{ countIt() return {redirectUrl:brws.runtime.getURL("html/crowd-bypassed.html")+details.url.substr(43)} -},{types:["main_frame"],urls:["https://universal-bypass.org/crowd-bypassed?*"]},["blocking"]) +},{types:["main_frame"],urls:["https://fastforward.team/crowd-bypassed?*"]},["blocking"]) brws.webRequest.onBeforeRequest.addListener(details=>{ return {redirectUrl:brws.runtime.getURL("html/options.html")+details.url.substr(36)} -},{types:["main_frame"],urls:["https://universal-bypass.org/options*"]},["blocking"]) +},{types:["main_frame"],urls:["https://fastforward.team/options*"]},["blocking"]) // Navigation handling including presenting referer header to destinations var refererCache={} @@ -500,7 +500,7 @@ brws.webRequest.onBeforeRequest.addListener(details=>{ refererCache[arr[0]]=decodeURIComponent(arr[1].split("&")[0]) } return {redirectUrl:arr[0]} -},{types:["main_frame"],urls:["*://universal-bypass.org/navigate?target=*"]},["blocking"]) +},{types:["main_frame"],urls:["*://fastforward.team/navigate?target=*"]},["blocking"]) let infoSpec=["blocking","requestHeaders"] if("EXTRA_HEADERS" in brws.webRequest.OnBeforeSendHeadersOptions) diff --git a/src/js/content_script.js b/src/js/content_script.js index 7d338d856..7518131c1 100644 --- a/src/js/content_script.js +++ b/src/js/content_script.js @@ -1,152 +1,152 @@ -//If you want to add your own bypass, go to injection_script.js -if(document instanceof Document) -{ - let clipboardIndex=location.hash.indexOf("#bypassClipboard="),ignoreCrowdBypass=false,bypassClipboard="" - if(location.hash.substr(-18)=="#ignoreCrowdBypass") - { - ignoreCrowdBypass=true - location.hash=location.hash.substr(0,location.hash.length-18) - } - if(clipboardIndex!=-1) - { - bypassClipboard=location.hash.substr(clipboardIndex+17) - location.hash=location.hash.substr(0,location.hash.length-bypassClipboard.length-17) - } - if(location.hash.substr(-18)=="#ignoreCrowdBypass") - { - ignoreCrowdBypass=true - location.hash=location.hash.substr(0,location.hash.length-18) - } - const simplifyDomain=domain=>{ - if(domain.substr(0,4)=="www.") - { - domain=domain.substr(4) - } - return domain - } - const brws=(typeof browser=="undefined"?chrome:browser) - brws.runtime.sendMessage({type: "content"}, res => { - if(!res.enabled) - { - return - } - const channel = res.channel, - observer = new MutationObserver(mutations => { - if(document.documentElement.hasAttribute(channel.stop_watching)) - { - document.documentElement.removeAttribute(channel.stop_watching) - observer.disconnect() - } - else if(document.documentElement.hasAttribute(channel.count_it)) - { - document.documentElement.removeAttribute(channel.count_it) - brws.runtime.sendMessage({type:"count-it"}) - } - else if(document.documentElement.hasAttribute(channel.crowd_referer)) - { - referer=document.documentElement.getAttribute(channel.crowd_referer) - document.documentElement.removeAttribute(channel.crowd_referer) - } - else if(document.documentElement.hasAttribute(channel.crowd_domain)) - { - domain=simplifyDomain(document.documentElement.getAttribute(channel.crowd_domain)) - document.documentElement.removeAttribute(channel.crowd_domain) - } - else if(document.documentElement.hasAttribute(channel.crowd_path)) - { - crowdPath=document.documentElement.getAttribute(channel.crowd_path) - document.documentElement.removeAttribute(channel.crowd_path) - } - else if(document.documentElement.hasAttribute(channel.crowd_query)) - { - document.documentElement.removeAttribute(channel.crowd_query) - let port=brws.runtime.connect({name: "crowd-query"}) - port.onMessage.addListener(msg=>{ - if(msg=="") - { - document.documentElement.setAttribute(channel.crowd_queried, "") - } - else - { - location.assign("https://universal-bypass.org/crowd-bypassed?target="+encodeURIComponent(msg)+"&referer="+encodeURIComponent(referer)) - //The background script will intercept the request and redirect to html/crowd-bypassed.html - } - port.disconnect() - }) - port.postMessage({domain, crowdPath}) - } - else if(document.documentElement.hasAttribute(channel.crowd_contribute)) - { - const target=document.documentElement.getAttribute(channel.crowd_contribute) - document.documentElement.removeAttribute(channel.crowd_contribute) - brws.runtime.sendMessage({ - type: "crowd-contribute", - data: "domain="+encodeURIComponent(domain)+"&path="+encodeURIComponent(crowdPath)+"&target="+encodeURIComponent(target) - }) - } - else if(document.documentElement.hasAttribute(channel.adlinkfly_info)) - { - document.documentElement.removeAttribute(channel.adlinkfly_info) - if(crowdPath==location.pathname.substr(1)) - { - let port=brws.runtime.connect({name: "adlinkfly-info"}) - port.onMessage.addListener(msg=>{ - document.documentElement.setAttribute(channel.adlinkfly_target, msg) - port.disconnect() - }) - port.postMessage(location.href) - } - else - { - document.documentElement.setAttribute(channel.adlinkfly_target, "") - } - } - else if(document.documentElement.hasAttribute(channel.bypass_clipboard)) - { - const clipboard=document.documentElement.getAttribute(channel.bypass_clipboard) - document.documentElement.removeAttribute(channel.bypass_clipboard) - brws.runtime.sendMessage({ - type: "bypass-clipboard", - data: clipboard - }) - } - }) - observer.observe(document.documentElement, {attributes: true}) - - let domain=simplifyDomain(location.hostname), - crowdPath=location.pathname.substr(1), - referer=location.href - - //ffclipboard reciever - window.addEventListener("message", function(event) { - // We only accept messages from ourselves - if (event.source != window) { - return; - } - if (event.data.type === "ffclipboardSet") { - brws.storage.local.set({ff_clipboard: event.data.text}) - } - }); - brws.storage.local.get('ff_clipboard', function(result) { - ffClipboard_stored = result.ff_clipboard - - //encodeURIcomponent and replace whatever's not encoded, https://stackoverflow.com/a/16435373/17117909 - ffClipboard_stored = encodeURIComponent(ffClipboard_stored).replace(/\-/g, "%2D").replace(/\_/g, "%5F").replace(/\./g, "%2E").replace(/\!/g, "%21").replace(/\~/g, "%7E").replace(/\*/g, "%2A").replace(/\'/g, "%27").replace(/\(/g, "%28").replace(/\)/g, "%29") - let script=document.createElement("script") - script.innerHTML=`(()=>{ - const crowdEnabled=`+(res.crowdEnabled?"true":"false")+`, - ignoreCrowdBypass=`+(ignoreCrowdBypass?"true":"false")+`, - bypassClipboard="`+bypassClipboard.split("\\").join("\\\\").split("\"").join("\\\"")+`" - let ffClipboard_stored="`+ffClipboard_stored+`" - if(location.href=="https://universal-bypass.org/firstrun") - { - location.replace("https://universal-bypass.org/firstrun?1") - return - } - `+res.injectionScript+` - })()` - script=document.documentElement.appendChild(script) - setTimeout(()=>document.documentElement.removeChild(script),10) - }); - }) -} +//If you want to add your own bypass, go to injection_script.js +if(document instanceof Document) +{ + let clipboardIndex=location.hash.indexOf("#bypassClipboard="),ignoreCrowdBypass=false,bypassClipboard="" + if(location.hash.substr(-18)=="#ignoreCrowdBypass") + { + ignoreCrowdBypass=true + location.hash=location.hash.substr(0,location.hash.length-18) + } + if(clipboardIndex!=-1) + { + bypassClipboard=location.hash.substr(clipboardIndex+17) + location.hash=location.hash.substr(0,location.hash.length-bypassClipboard.length-17) + } + if(location.hash.substr(-18)=="#ignoreCrowdBypass") + { + ignoreCrowdBypass=true + location.hash=location.hash.substr(0,location.hash.length-18) + } + const simplifyDomain=domain=>{ + if(domain.substr(0,4)=="www.") + { + domain=domain.substr(4) + } + return domain + } + const brws=(typeof browser=="undefined"?chrome:browser) + brws.runtime.sendMessage({type: "content"}, res => { + if(!res.enabled) + { + return + } + const channel = res.channel, + observer = new MutationObserver(mutations => { + if(document.documentElement.hasAttribute(channel.stop_watching)) + { + document.documentElement.removeAttribute(channel.stop_watching) + observer.disconnect() + } + else if(document.documentElement.hasAttribute(channel.count_it)) + { + document.documentElement.removeAttribute(channel.count_it) + brws.runtime.sendMessage({type:"count-it"}) + } + else if(document.documentElement.hasAttribute(channel.crowd_referer)) + { + referer=document.documentElement.getAttribute(channel.crowd_referer) + document.documentElement.removeAttribute(channel.crowd_referer) + } + else if(document.documentElement.hasAttribute(channel.crowd_domain)) + { + domain=simplifyDomain(document.documentElement.getAttribute(channel.crowd_domain)) + document.documentElement.removeAttribute(channel.crowd_domain) + } + else if(document.documentElement.hasAttribute(channel.crowd_path)) + { + crowdPath=document.documentElement.getAttribute(channel.crowd_path) + document.documentElement.removeAttribute(channel.crowd_path) + } + else if(document.documentElement.hasAttribute(channel.crowd_query)) + { + document.documentElement.removeAttribute(channel.crowd_query) + let port=brws.runtime.connect({name: "crowd-query"}) + port.onMessage.addListener(msg=>{ + if(msg=="") + { + document.documentElement.setAttribute(channel.crowd_queried, "") + } + else + { + location.assign("https://fastforward.team/crowd-bypassed?target="+encodeURIComponent(msg)+"&referer="+encodeURIComponent(referer)) + //The background script will intercept the request and redirect to html/crowd-bypassed.html + } + port.disconnect() + }) + port.postMessage({domain, crowdPath}) + } + else if(document.documentElement.hasAttribute(channel.crowd_contribute)) + { + const target=document.documentElement.getAttribute(channel.crowd_contribute) + document.documentElement.removeAttribute(channel.crowd_contribute) + brws.runtime.sendMessage({ + type: "crowd-contribute", + data: "domain="+encodeURIComponent(domain)+"&path="+encodeURIComponent(crowdPath)+"&target="+encodeURIComponent(target) + }) + } + else if(document.documentElement.hasAttribute(channel.adlinkfly_info)) + { + document.documentElement.removeAttribute(channel.adlinkfly_info) + if(crowdPath==location.pathname.substr(1)) + { + let port=brws.runtime.connect({name: "adlinkfly-info"}) + port.onMessage.addListener(msg=>{ + document.documentElement.setAttribute(channel.adlinkfly_target, msg) + port.disconnect() + }) + port.postMessage(location.href) + } + else + { + document.documentElement.setAttribute(channel.adlinkfly_target, "") + } + } + else if(document.documentElement.hasAttribute(channel.bypass_clipboard)) + { + const clipboard=document.documentElement.getAttribute(channel.bypass_clipboard) + document.documentElement.removeAttribute(channel.bypass_clipboard) + brws.runtime.sendMessage({ + type: "bypass-clipboard", + data: clipboard + }) + } + }) + observer.observe(document.documentElement, {attributes: true}) + + let domain=simplifyDomain(location.hostname), + crowdPath=location.pathname.substr(1), + referer=location.href + + //ffclipboard reciever + window.addEventListener("message", function(event) { + // We only accept messages from ourselves + if (event.source != window) { + return; + } + if (event.data.type === "ffclipboardSet") { + brws.storage.local.set({ff_clipboard: event.data.text}) + } + }); + brws.storage.local.get('ff_clipboard', function(result) { + ffClipboard_stored = result.ff_clipboard + + //encodeURIcomponent and replace whatever's not encoded, https://stackoverflow.com/a/16435373/17117909 + ffClipboard_stored = encodeURIComponent(ffClipboard_stored).replace(/\-/g, "%2D").replace(/\_/g, "%5F").replace(/\./g, "%2E").replace(/\!/g, "%21").replace(/\~/g, "%7E").replace(/\*/g, "%2A").replace(/\'/g, "%27").replace(/\(/g, "%28").replace(/\)/g, "%29") + let script=document.createElement("script") + script.innerHTML=`(()=>{ + const crowdEnabled=`+(res.crowdEnabled?"true":"false")+`, + ignoreCrowdBypass=`+(ignoreCrowdBypass?"true":"false")+`, + bypassClipboard="`+bypassClipboard.split("\\").join("\\\\").split("\"").join("\\\"")+`" + let ffClipboard_stored="`+ffClipboard_stored+`" + if(location.href=="https://fastforward.team/firstrun") + { + location.replace("https://fastforward.team/firstrun?1") + return + } + `+res.injectionScript+` + })()` + script=document.documentElement.appendChild(script) + setTimeout(()=>document.documentElement.removeChild(script),10) + }); + }) +} diff --git a/src/js/injection_script.js b/src/js/injection_script.js index c7f7e9db4..46a9e5f6f 100644 --- a/src/js/injection_script.js +++ b/src/js/injection_script.js @@ -67,7 +67,7 @@ unsafelyNavigate=target=>{ return } //The background script will intercept the request and redirect to html/before-navigate.html or to the target depending on the user's settings. - let url="https://universal-bypass.org/bypassed?target="+encodeURIComponent(target)+"&referer="+encodeURIComponent(referer) + let url="https://fastforward.team/bypassed?target="+encodeURIComponent(target)+"&referer="+encodeURIComponent(referer) switch(target)//All values here have been tested using "Take me to destinations after 0 seconds." { case (/(krnl\.place|hugegames\.io)/.exec(target)||{}).input: @@ -112,7 +112,7 @@ safelyAssign=target=>{ }, unsafelyAssignWithReferer=(target,referer)=>{ //The background script will intercept this request and handle it. - location.href="https://universal-bypass.org/navigate?target="+encodeURIComponent(target)+"&referer="+encodeURIComponent(referer) + location.href="https://fastforward.team/navigate?target="+encodeURIComponent(target)+"&referer="+encodeURIComponent(referer) }, finish=()=>{ bypassed=true @@ -344,7 +344,7 @@ decodeURIEncodedMod=(s)=>{ } //Backwards compatibility for ffclipboard -versionString = 'UNIVERSAL_BYPASS_EXTERNAL_VERSION' +versionString = 'FAST_FORWARD_EXTERNAL_VERSION' let versionPatchNumber = Number(versionString.split(".").pop()) let ffClpbrdSupported = false if(versionPatchNumber >= 1924) { @@ -884,11 +884,11 @@ hrefBypass(/firefaucet\.win\/l\/|sfirmware\.com\/downloads-file\/|(apkily\.com\/ hrefBypass(/emulator\.games\/download\.php|curseforge\.com\/.*\/download\/[0-9]*/,()=>window.setInterval=f=>setInterval(f,100)) domainBypass(/^((www\.)?((racaty|longfiles|filepuma|portableapps)\.com|indishare\.org|datei\.to|keisekai\.fun|solvetube\.site))$/,()=>window.setTimeout=f=>setTimeout(f,1)) domainBypass(/lkc21\.net|layarkacaxxi\.org/,()=>window.setTimeout=f=>setTimeout(f,100)) -domainBypass("universal-bypass.org",()=>{ - window.universalBypassInstalled=true - window.universalBypassInternalVersion=UNIVERSAL_BYPASS_INTERNAL_VERSION - window.universalBypassExternalVersion="UNIVERSAL_BYPASS_EXTERNAL_VERSION" - window.universalBypassInjectionVersion="UNIVERSAL_BYPASS_INJECTION_VERSION" +domainBypass("fastforward.team",()=>{ + window.fastForwardInstalled=true + window.fastForwardInternalVersion=FAST_FORWARD_INTERNAL_VERSION + window.fastForwardExternalVersion="FAST_FORWARD_EXTERNAL_VERSION" + window.fastForwardInjectionVersion="FAST_FORWARD_INJECTION_VERSION" }) domainBypass("acortame.xyz", () => { @@ -952,7 +952,7 @@ ensureDomLoaded(()=>{ persistHash("ignoreCrowdBypass") } domainBypass(/^((www\.)?((file(factory|-upload)|asdfiles|mega4up)\.com|up-load\.io|cosmobox\.org|rockfile\.co|devdrive\.cloud))$/,()=>insertInfoBox("{{msg.infoFileHoster}}")) - domainBypass(/linkvertise\.(com|net)|link-to\.net/,()=>insertInfoBox(UNIVERSAL_BYPASS_INTERNAL_VERSION>=9?"{{msg.infoLinkvertise}}":"We're not allowed to bypass this website but we have negotiated the removal of their most annoying steps.")) + domainBypass(/linkvertise\.(com|net)|link-to\.net/,()=>insertInfoBox(FAST_FORWARD_INTERNAL_VERSION>=9?"{{msg.infoLinkvertise}}":"We're not allowed to bypass this website but we have negotiated the removal of their most annoying steps.")) domainBypass("srt.am",()=>{ if(document.querySelector(".skip-container")) { @@ -1517,7 +1517,7 @@ ensureDomLoaded(()=>{ domainBypass(/(kora4top)\.com/,()=>ifElement("div#m1x2 a",safelyNavigate)) domainBypass(/(forexlap|forex-articles|forexmab)\.com/, () => { ensureDomLoaded(() => { - ifElement("center.oto>a", a => { + ifElement("center.oto>a", a => { a.click() }) }) }) @@ -2058,7 +2058,7 @@ ensureDomLoaded(()=>{ // }) //}) - + domainBypass("theepochtimes.com", () => { awaitElement("#landing-page", subscriptionWall => { subscriptionWall.remove() @@ -2714,7 +2714,7 @@ domainBypass('apkadmin.com', () => { domainBypass("filedm.com",()=>{awaitElement("a#dlbutton",a=>{ safelyNavigate("http://directdl.xyz/dm.php?id="+a.href.split("_")[1])} )}) - + domainBypass("bowfile.com", () => { const regex=/.*let next = "(http[^"]+)";.*/ document.querySelectorAll("script").forEach(script=>{ @@ -2855,7 +2855,7 @@ domainBypass("acorta-link.com", () => { let t=document.documentElement.getAttribute("{{channel.adlinkfly_target}}") if(t=="") { - if(UNIVERSAL_BYPASS_INTERNAL_VERSION>=10&&bypassClipboard.substr(0,8)=="psarips:") + if(FAST_FORWARD_INTERNAL_VERSION>=10&&bypassClipboard.substr(0,8)=="psarips:") { persistHash("bypassClipboard="+bypassClipboard) crowdDomain("psarips.com") diff --git a/tests/index.js b/tests/index.js index 0246b1fb3..01e554594 100644 --- a/tests/index.js +++ b/tests/index.js @@ -1,83 +1,83 @@ -const puppeteer = require('puppeteer') -const path = require('path') - -const { EventEmitter } = require('events'); -const { URL } = require('url'); - -const bypasses = require('./bypasses.json'); - - - -class TimeoutError extends Error { - constructor(message) { - super(message); - this.name = this.constructor.name; - Error.captureStackTrace(this, this.constructor); - } -} - - -(async() => { - const browser = await puppeteer.launch({ - headless: false, - args: [ - '--no-sandbox', - `--load-extension=${path.join(__dirname, '../build/FastForward.chromium')}` - ], - ignoreDefaultArgs: ['--disable-extensions', '--enable-automation'] - }); - - // We do not need to view the FastForward site - browser.on('targetcreated', async target => { - if (target.url() === 'https://universal-bypass.org/firstrun') { - const targetPage = await target.page() - targetPage.close() - return; - } - }) - const page = await browser.newPage() - await page.setRequestInterception(true); - // A custom EventEmitter to emit url changes - const urlEmitter = new EventEmitter() - page.on('request', request => { - const url = new URL(request.url()) - urlEmitter.emit('change', url.host) - request.continue(); - }) - - const waitForDomain = (domain, timeoutms) => { - return new Promise((resolve, reject) => { - const timeout = setTimeout(() => { - reject(new TimeoutError(`Timeout limit of ${timeoutms}ms has been exceeded`)) - }, timeoutms) - const listener = urlEmitter.on('change', changedURL => { - if (domain === changedURL) { - clearTimeout(timeout) - resolve(); - urlEmitter.removeListener('change', listener); - } - }) - }) - } - - // Wait 3 seconds for FastForward to load - setTimeout(async () => { - for (const url in bypasses) { - const destination = bypasses[url].destination - const timeout = bypasses[url].timeout || 5000 - console.log(`⌛ Testing "${url}" with expected destination "${destination}"`) - await page.goto(url) - await waitForDomain(destination, timeout) - .then(() => { - console.log(`✔️ Success`) - }) - .catch(err => { - console.log(`❌ Failed at ${url}. ${err.message}`) - process.exit(1) - }) - } - console.log('✓ All bypasses have passed the test!') - }, 3000) - - -})() +const puppeteer = require('puppeteer') +const path = require('path') + +const { EventEmitter } = require('events'); +const { URL } = require('url'); + +const bypasses = require('./bypasses.json'); + + + +class TimeoutError extends Error { + constructor(message) { + super(message); + this.name = this.constructor.name; + Error.captureStackTrace(this, this.constructor); + } +} + + +(async() => { + const browser = await puppeteer.launch({ + headless: false, + args: [ + '--no-sandbox', + `--load-extension=${path.join(__dirname, '../build/FastForward.chromium')}` + ], + ignoreDefaultArgs: ['--disable-extensions', '--enable-automation'] + }); + + // We do not need to view the FastForward site + browser.on('targetcreated', async target => { + if (target.url() === 'https://fastforward.team/firstrun') { + const targetPage = await target.page() + targetPage.close() + return; + } + }) + const page = await browser.newPage() + await page.setRequestInterception(true); + // A custom EventEmitter to emit url changes + const urlEmitter = new EventEmitter() + page.on('request', request => { + const url = new URL(request.url()) + urlEmitter.emit('change', url.host) + request.continue(); + }) + + const waitForDomain = (domain, timeoutms) => { + return new Promise((resolve, reject) => { + const timeout = setTimeout(() => { + reject(new TimeoutError(`Timeout limit of ${timeoutms}ms has been exceeded`)) + }, timeoutms) + const listener = urlEmitter.on('change', changedURL => { + if (domain === changedURL) { + clearTimeout(timeout) + resolve(); + urlEmitter.removeListener('change', listener); + } + }) + }) + } + + // Wait 3 seconds for FastForward to load + setTimeout(async () => { + for (const url in bypasses) { + const destination = bypasses[url].destination + const timeout = bypasses[url].timeout || 5000 + console.log(`⌛ Testing "${url}" with expected destination "${destination}"`) + await page.goto(url) + await waitForDomain(destination, timeout) + .then(() => { + console.log(`✔️ Success`) + }) + .catch(err => { + console.log(`❌ Failed at ${url}. ${err.message}`) + process.exit(1) + }) + } + console.log('✓ All bypasses have passed the test!') + }, 3000) + + +})()