Fix close tab still not always working on Firefox (closes #937)

This commit is contained in:
Tim "timmyRS" Speckhals 2020-02-17 12:43:58 +01:00
parent 791ca6a174
commit 9364247ed9
4 changed files with 5 additions and 6 deletions

View File

@ -49,10 +49,6 @@ foreach($index as $fn)
if($fn == "manifest.json")
{
$json = json_decode(file_get_contents($fn), true);
$json["permissions"] = array_values(array_filter($json["permissions"], function($value)
{
return $value != "tabs";
}));
unset($json["browser_specific_settings"]);
$json["incognito"] = "split";
$chromium_build->addFromString($fn, json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));

View File

@ -275,6 +275,10 @@ brws.runtime.onMessage.addListener((req, sender, respond) => {
})
break;
case "close-tab":
brws.tabs.remove(sender.tab.id)
break;
case "crowd-contribute":
if(crowdEnabled)
{

View File

@ -5,7 +5,7 @@ if(args.has("target")&&args.has("referer"))
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,true,()=>{
brws.tabs.getCurrent(t=>brws.tabs.remove(t.id))
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")

View File

@ -16,7 +16,6 @@
"permissions": [
"alarms",
"storage",
"tabs",
"webRequest",
"webRequestBlocking",
"<all_urls>"