From e05eb27e6ad35935805b3c8ce0372d714d309247 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Thu, 20 Sep 2018 21:30:45 +0200 Subject: [PATCH] updating popup url --- js/lib/Comms.js | 2 +- js/modules/PageInfo.js | 1 + res/popup/js/popup.js | 7 +++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/js/lib/Comms.js b/js/lib/Comms.js index 225e3e1..ff52764 100644 --- a/js/lib/Comms.js +++ b/js/lib/Comms.js @@ -260,7 +260,7 @@ class CommsServer { const currentUrl = await this.getCurrentTabHostname(); if (message.url === currentUrl) { - this.server.url = message.url; + this.server.currentSite = message.url; if(Debug.debug) { // we want to get these messages always when debugging console.log("[Comms::processReceivedMessage] hostname matches currently active tab. active:", currentUrl, "message:", message.url); diff --git a/js/modules/PageInfo.js b/js/modules/PageInfo.js index c0d30a8..936fad2 100644 --- a/js/modules/PageInfo.js +++ b/js/modules/PageInfo.js @@ -175,6 +175,7 @@ class PageInfo { this.rescan(RescanReason.URL_CHANGE); this.lastUrl = window.location.href; + this.comms.registerTab(); } this.scheduleUrlCheck(); diff --git a/res/popup/js/popup.js b/res/popup/js/popup.js index 79cc351..cca3f8c 100644 --- a/res/popup/js/popup.js +++ b/res/popup/js/popup.js @@ -361,6 +361,8 @@ function configureVideoTab() { async function loadConfig(site){ + console.log("NEW CONFIG!") + if (Debug.debug) { console.log("\n\n-------------------------------------\n[popup.js::loadConfig] loading config. conf object:", settings.active); } @@ -767,7 +769,7 @@ document.addEventListener("click", (e) => { async function sleep(t) { return new Promise( (resolve,reject) => { - setTimeout(t, () => resolve()); + setTimeout(() => resolve(), t); }); } @@ -798,7 +800,8 @@ async function popup_init() { // }); hideWarning("script-not-running-warning"); - while (!this.site) { + while (true) { + console.log("GETTING SITE") getSite(); await sleep(5000); }