diff --git a/js/conf/Debug.js b/js/conf/Debug.js index 3228b30..9046d0d 100644 --- a/js/conf/Debug.js +++ b/js/conf/Debug.js @@ -1,10 +1,10 @@ // Set prod to true when releasing -_prod = true; -// _prod = false; +//_prod = true; +_prod = false; Debug = { init: true, - debug: false, + debug: true, keyboard: true, debugResizer: true, debugArDetect: true, diff --git a/js/lib/Comms.js b/js/lib/Comms.js index d82e38b..f7ab7c9 100644 --- a/js/lib/Comms.js +++ b/js/lib/Comms.js @@ -24,7 +24,9 @@ class CommsClient { destroy() { this.pageInfo = null; this.settings = null; - this.port.onMessage.removeListener(this._listener); + if (!BrowserDetect.edge) { // edge is a very special browser made by outright morons. + this.port.onMessage.removeListener(this._listener); + } } setPageInfo(pageInfo){ @@ -37,7 +39,9 @@ class CommsClient { var ths = this; this._listener = m => ths.processReceivedMessage(m); - this.port.onMessage.removeListener(this._listener); + if (!BrowserDetect.edge) { + this.port.onMessage.removeListener(this._listener); + } this.port.onMessage.addListener(this._listener); } diff --git a/js/lib/Settings.js b/js/lib/Settings.js index 06a7fc1..63fc05d 100644 --- a/js/lib/Settings.js +++ b/js/lib/Settings.js @@ -103,8 +103,8 @@ class Settings { } async get() { - if (BrowserDetect.firefox || BrowserDetect.edge) { - const ret = this.useSync ? await browser.storage.sync.get('uwSettings') : await browser.storage.local.get('uwSettings'); + if (BrowserDetect.firefox) { + const ret = await browser.storage.local.get('uwSettings'); try { return JSON.parse(ret.uwSettings); } catch(e) { @@ -115,6 +115,11 @@ class Settings { chrome.storage.sync.get('uwSettings', (res) => resolve(res)); }); return ret['uwSettings']; + } else if (BrowserDetect.edge) { + const ret = new Promise( (resolve, reject) => { + browser.storage.sync.get('uwSettings', (res) => resolve(res)); + }); + return ret['uwSettings']; } } diff --git a/js/modules/PageInfo.js b/js/modules/PageInfo.js index d437a91..2eb84a2 100644 --- a/js/modules/PageInfo.js +++ b/js/modules/PageInfo.js @@ -106,8 +106,6 @@ class PageInfo { } this.removeDestroyed(); - - // console.log("Rescan complete. Total videos?", this.videos.length) }catch(e){ console.log("rescan error:",e) } diff --git a/js/uw.js b/js/uw.js index f01d8b3..c493db5 100644 --- a/js/uw.js +++ b/js/uw.js @@ -12,6 +12,9 @@ if(Debug.debug){ } } +if (BrowserDetect.edge) { + HTMLCollection.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator]; +} class UW { constructor(){ diff --git a/releases/edge/ultrawidify_edge_v3.2.2.zip b/releases/edge/ultrawidify_edge_v3.2.2.zip new file mode 100644 index 0000000..d9d6490 Binary files /dev/null and b/releases/edge/ultrawidify_edge_v3.2.2.zip differ diff --git a/res/css/common.css b/res/css/common.css index e6f6e14..ad12dfc 100644 --- a/res/css/common.css +++ b/res/css/common.css @@ -146,6 +146,22 @@ strike { background-color: #222 !important; } +/* BROWSER-SPECIFIC DISABLE */ +.disabled-edge { + pointer-events: none !important; + filter: contrast(50%) brightness(40%) grayscale(100%) !important; + content: "NOT SUPPORTED IN THIS BROWSER"; +} +.disabled-edge::after { + background-color: #333272; + color: #d8d9e6; + display: inline-block; + font-size: .75em; + font-variant: small-caps; + padding-left: 5px; + padding-right: 5px; + margin-left: 10px; +} /* BUTTONS AND INPUTS */ diff --git a/res/popup/js/popup.js b/res/popup/js/popup.js index 0524a5a..cf1b046 100644 --- a/res/popup/js/popup.js +++ b/res/popup/js/popup.js @@ -494,7 +494,9 @@ function validateAutoArTimeout(){ } document.addEventListener("click", (e) => { - + if(Debug.debug) { + console.log("[popup.js] something clicked. event:", e, JSON.stringify(e)); + } function getcmd(e){ var command = {}; @@ -791,7 +793,12 @@ document.addEventListener("click", (e) => { //#endregion } - var command = getcmd(e); + var command = getcmd(e); + + if(Debug.debug) { + console.log("[popup.js] Got command (can be undefined):", command, JSON.stringify(command)) + } + if(command) port.postMessage(command);