« get me outta code hell

Rule Scope - interactive-bgm - Browser extension that adds background music based on the site you're browsing
about summary refs log tree commit diff
path: root/extension/interactive-bgm.js
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2019-03-23 19:25:26 -0300
committerFlorrie <towerofnix@gmail.com>2019-03-23 19:25:26 -0300
commita55a4500ee8262d4c9c50d7c769ebc8cb742bb93 (patch)
treec9811aa397282453888e1e747c3c028c5262c6af /extension/interactive-bgm.js
parente03b677b1d92ee7a0b139c23cb8076c44770e903 (diff)
Rule Scope
Diffstat (limited to 'extension/interactive-bgm.js')
-rw-r--r--extension/interactive-bgm.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/extension/interactive-bgm.js b/extension/interactive-bgm.js
index 773391f..5db7d58 100644
--- a/extension/interactive-bgm.js
+++ b/extension/interactive-bgm.js
@@ -1,18 +1,18 @@
-const sendHostname = () => {
-    browser.runtime.sendMessage({hostname: location.hostname});
+const sendURL = () => {
+    browser.runtime.sendMessage({urlString: location.toString()});
 };
 
-window.addEventListener('focus', sendHostname);
+window.addEventListener('focus', sendURL);
 
 document.addEventListener('visibilitychange', () => {
     if (!document.hidden) {
-        sendHostname();
+        sendURL();
     }
 });
 
 window.addEventListener('load', () => {
     if (!document.hidden) {
-        sendHostname();
+        sendURL();
     }
 });