Fix auto-closing of the crowd-sourced destination tab not working

This commit is contained in:
Tim "timmyRS" Speckhals 2020-02-09 10:43:37 +01:00
parent b7942af624
commit 64679e892d

View File

@ -4,7 +4,9 @@ if(args.has("target")&&args.has("referer"))
let span=document.querySelector('[data-message="crowdBypassedInfo"]'),opentimer
span.innerHTML=span.innerHTML.replace("%",'<a target="_blank"></a>')
const a=span.querySelector("a"),
closetimer=()=>brws.storage.sync.get(["crowd_close_delay"],res=>timer("crowdCloseTimer",res.crowd_close_delay,()=>window.close()))
closetimer=()=>brws.storage.sync.get(["crowd_close_delay"],res=>timer("crowdCloseTimer",res.crowd_close_delay,()=>{
brws.tabs.getCurrent(t=>brws.tabs.remove(t.id))
}))
a.textContent=args.get("target")
a.href=args.has("referer")?"https://universal-bypass.org/navigate"+location.search:args.get("target")
a.onclick=()=>{