Skip to content
Snippets Groups Projects
Commit 02893788 authored by didierfred's avatar didierfred
Browse files
parents dedaae62 4c06bb7d
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,8 @@ It's possible to:
The extension can be start and stop via the button on the top right.
The rules are active in private window mode but you can't use the configuration window in this mode.
The code is opensource under Mozilla Public License 2.0
......
......@@ -10,7 +10,7 @@
},
"permissions": [
"activeTab","storage","webRequest", "webRequestBlocking", "<all_urls>"
"activeTab","storage","webRequest", "webRequestBlocking", "<all_urls>" ,"tabs"
],
"background": {
......
......@@ -41,7 +41,24 @@ function start_modify()
function start_config()
{
//var strWindowFeatures = "menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,width=800,height=600";
// window.open("config.html","Simple Modify Headers",strWindowFeatures);
browser.tabs.create({url:"config.html"});
var promise_tabs = browser.tabs.query({currentWindow: true});
promise_tabs.then(loadConfigTab);
}
function loadConfigTab(tabs)
{
var config_tab;
// search for config tab
for (let tab of tabs)
{
if (tab.url.startsWith(browser.extension.getURL(""))) config_tab = tab;
}
// config tab exits , put the focus on it
if (config_tab) browser.tabs.update(config_tab.id,{active:true})
// else create a new tab
else browser.tabs.create({url:"config.html"});
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment