aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/settings.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-19 22:28:23 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-19 22:28:23 -0400
commitdbec4bffda00615fe768f66c1eb5d895aea05585 (patch)
tree54dccc8a6b9d73b67d990b8be59d3c38604de027 /ext/bg/js/settings.js
parenta5d7de8e97400f63c328ccde9b313a127cef0611 (diff)
Make the search button reuse an open search tab if it exists
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;
}
}