aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/settings.js
diff options
context:
space:
mode:
authorAlex Yatskov <FooSoft@users.noreply.github.com>2019-10-20 11:06:23 -0700
committerGitHub <noreply@github.com>2019-10-20 11:06:23 -0700
commitd8f9c2e1d43a7c37103d7f9a58039bffa4aac495 (patch)
treedca6abf8ef84eb8cc714ad1f5e78a24a6dbaa21c /ext/bg/js/settings.js
parent65923238556212fef2d7ed7a156373c88382ffd2 (diff)
parent362a1ed9e4621c47b4dca99777015b90fc90451c (diff)
Merge pull request #261 from toasted-nutbread/search-button-reuse-tab
Reuse open search tab when clicking search button
Diffstat (limited to 'ext/bg/js/settings.js')
-rw-r--r--ext/bg/js/settings.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/bg/js/settings.js b/ext/bg/js/settings.js
index 2c77a0ed..05a0604a 100644
--- a/ext/bg/js/settings.js
+++ b/ext/bg/js/settings.js
@@ -430,9 +430,14 @@ async function onOptionsUpdate({source}) {
await formWrite(options);
}
-function onMessage({action, params}) {
- if (action === 'optionsUpdate') {
- onOptionsUpdate(params);
+function onMessage({action, params}, sender, callback) {
+ switch (action) {
+ case 'optionsUpdate':
+ onOptionsUpdate(params);
+ break;
+ case 'getUrl':
+ callback({url: window.location.href});
+ break;
}
}