diff --git a/popup/menu.js b/popup/menu.js index 91a5ce573d6a95d295629893c85212e703cd315d..bef74f7bf489d1fe359a5c996b6fb75b00bc8d04 100644 --- a/popup/menu.js +++ b/popup/menu.js @@ -37,8 +37,31 @@ function start_modify() 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() { var promise_tabs = browser.tabs.query({currentWindow: true});