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

Wrap popup init with settings request #246

Merged
merged 1 commit into from
Apr 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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