Fixed some edge-specific bugs
This commit is contained in:
parent
255cdd9820
commit
ee268c5e9c
@ -1,10 +1,10 @@
|
|||||||
// Set prod to true when releasing
|
// Set prod to true when releasing
|
||||||
_prod = true;
|
//_prod = true;
|
||||||
// _prod = false;
|
_prod = false;
|
||||||
|
|
||||||
Debug = {
|
Debug = {
|
||||||
init: true,
|
init: true,
|
||||||
debug: false,
|
debug: true,
|
||||||
keyboard: true,
|
keyboard: true,
|
||||||
debugResizer: true,
|
debugResizer: true,
|
||||||
debugArDetect: true,
|
debugArDetect: true,
|
||||||
|
@ -103,8 +103,8 @@ class Settings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async get() {
|
async get() {
|
||||||
if (BrowserDetect.firefox || BrowserDetect.edge) {
|
if (BrowserDetect.firefox) {
|
||||||
const ret = this.useSync ? await browser.storage.sync.get('uwSettings') : await browser.storage.local.get('uwSettings');
|
const ret = await browser.storage.local.get('uwSettings');
|
||||||
try {
|
try {
|
||||||
return JSON.parse(ret.uwSettings);
|
return JSON.parse(ret.uwSettings);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
@ -115,6 +115,11 @@ class Settings {
|
|||||||
chrome.storage.sync.get('uwSettings', (res) => resolve(res));
|
chrome.storage.sync.get('uwSettings', (res) => resolve(res));
|
||||||
});
|
});
|
||||||
return ret['uwSettings'];
|
return ret['uwSettings'];
|
||||||
|
} else if (BrowserDetect.edge) {
|
||||||
|
const ret = new Promise( (resolve, reject) => {
|
||||||
|
browser.storage.sync.get('uwSettings', (res) => resolve(res));
|
||||||
|
});
|
||||||
|
return ret['uwSettings'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
js/uw.js
3
js/uw.js
@ -12,6 +12,9 @@ if(Debug.debug){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (BrowserDetect.edge) {
|
||||||
|
HTMLCollection.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator];
|
||||||
|
}
|
||||||
|
|
||||||
class UW {
|
class UW {
|
||||||
constructor(){
|
constructor(){
|
||||||
|
@ -494,7 +494,9 @@ function validateAutoArTimeout(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener("click", (e) => {
|
document.addEventListener("click", (e) => {
|
||||||
|
if(Debug.debug) {
|
||||||
|
console.log("[popup.js] something clicked. event:", e, JSON.stringify(e));
|
||||||
|
}
|
||||||
|
|
||||||
function getcmd(e){
|
function getcmd(e){
|
||||||
var command = {};
|
var command = {};
|
||||||
@ -792,6 +794,11 @@ document.addEventListener("click", (e) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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)
|
if(command)
|
||||||
port.postMessage(command);
|
port.postMessage(command);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user