Skip to content
Snippets Groups Projects
Commit 1f847b75 authored by didierfred's avatar didierfred
Browse files

Reload Config UI if start or stop

parent 18c7ff64
No related branches found
No related tags found
No related merge requests found
...@@ -37,8 +37,31 @@ function start_modify() ...@@ -37,8 +37,31 @@ function start_modify()
document.getElementById("start_stop").value = "Start"; document.getElementById("start_stop").value = "Start";
} }
// reload config tab , to get the start/stop information correct
var promise_tabs = browser.tabs.query({currentWindow: true});
promise_tabs.then(reloadConfigTab);
}
function reloadConfigTab(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 , reload it
if (config_tab) browser.tabs.reload(config_tab.id);
} }
function start_config() function start_config()
{ {
var promise_tabs = browser.tabs.query({currentWindow: true}); var promise_tabs = browser.tabs.query({currentWindow: true});
......
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