diff --git a/chrome/script.browserify.js b/chrome/script.browserify.js index 05bbcd9..0ef7521 100644 --- a/chrome/script.browserify.js +++ b/chrome/script.browserify.js @@ -12,11 +12,16 @@ var error; var domain, urlDuringSearch; var searchSettings; -m.mount(document.getElementById("mount"), { view: view, oncreate: oncreate }); +// load settings and initialise popup +chrome.runtime.sendMessage({ action: "getSettings" }, function(settings) { + searchSettings = settings; + + m.mount(document.getElementById("mount"), { view: view, oncreate: oncreate }); -chrome.tabs.onActivated.addListener(init); -chrome.tabs.query({ lastFocusedWindow: true, active: true }, function(tabs) { - init(tabs[0]); + chrome.tabs.onActivated.addListener(init); + chrome.tabs.query({ lastFocusedWindow: true, active: true }, function(tabs) { + init(tabs[0]); + }); }); function view() {