Skip to content
This repository has been archived by the owner on May 27, 2019. It is now read-only.

Commit

Permalink
Load settings before initializing the popup (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
erayd authored and maximbaz committed Apr 2, 2018
1 parent 070971c commit 3043b5c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions chrome/script.browserify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 3043b5c

Please sign in to comment.