aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-08 22:29:23 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-13 23:11:56 -0500
commit4177b6372696d9b424857fedd1be988cc7eb0095 (patch)
treeb7f0fb5f3ccb39f49f0c632935efead016ffcc45 /ext/mixed
parent573f83b65a8a0f87def6f4200ce503d957464f0d (diff)
Remove redundant getUrl handlers
Diffstat (limited to 'ext/mixed')
-rw-r--r--ext/mixed/js/core.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/ext/mixed/js/core.js b/ext/mixed/js/core.js
index b9536391..36056c36 100644
--- a/ext/mixed/js/core.js
+++ b/ext/mixed/js/core.js
@@ -225,3 +225,21 @@ class EventDispatcher {
return false;
}
}
+
+
+/*
+ * Default message handlers
+ */
+
+(() => {
+ function onMessage({action}, sender, callback) {
+ switch (action) {
+ case 'getUrl':
+ callback({url: window.location.href});
+ break;
+ }
+ return false;
+ }
+
+ chrome.runtime.onMessage.addListener(onMessage);
+})();