Fix bugs
This commit is contained in:
parent
2df3c3c9be
commit
bc89a9c116
@ -4,23 +4,22 @@ const _prod = false;
|
||||
|
||||
var Debug = {
|
||||
// performanceMetrics: true, // should not be affected by debug.debug in order to allow benchmarking of the impact logging in console has
|
||||
// init: true,
|
||||
init: true,
|
||||
debug: true,
|
||||
// debug: false,
|
||||
// keyboard: true,
|
||||
keyboard: true,
|
||||
resizer: true,
|
||||
// debugArDetect: true,
|
||||
// scaler: true,
|
||||
debugArDetect: true,
|
||||
scaler: true,
|
||||
// debugStorage: false,
|
||||
debugStorage: true,
|
||||
// comms: false,
|
||||
// comms: true,
|
||||
comms: true,
|
||||
// showArDetectCanvas: true,
|
||||
// flushStoredSettings: true,
|
||||
// flushStoredSettings: false,
|
||||
playerDetect: true,
|
||||
// periodic: true,
|
||||
// videoRescan: true,
|
||||
videoRescan: true,
|
||||
// mousemove: true,
|
||||
// arDetect: {
|
||||
// edgeDetect: true
|
||||
|
@ -214,7 +214,8 @@ class CommsServer {
|
||||
processReceivedMessage_nonpersistent(message, sender, sendResponse){
|
||||
if (Debug.debug && Debug.comms) {
|
||||
console.log("%c[CommsServer.js::processMessage_nonpersistent] Received message from background script!", "background-color: #11D; color: #aad", message, sender);
|
||||
|
||||
}
|
||||
|
||||
if (message.cmd === 'inject-css') {
|
||||
this.server.injectCss(message.cssString, sender);
|
||||
return;
|
||||
|
@ -99,10 +99,6 @@ class PageInfo {
|
||||
|
||||
if (videos.length) {
|
||||
return videos;
|
||||
} else {
|
||||
if (Debug.debug) {
|
||||
console.log("[PageInfo::getVideos] Finding videos by querySelector failed. Trying fallback mode as well.");
|
||||
}
|
||||
}
|
||||
}
|
||||
return document.getElementsByTagName('video');
|
||||
@ -118,6 +114,9 @@ class PageInfo {
|
||||
this.hasVideos = false;
|
||||
|
||||
if(rescanReason == RescanReason.PERIODIC){
|
||||
if (Debug.debug && Debug.videoRescan && Debug.periodic) {
|
||||
console.log("[PageInfo::rescan] Scheduling normal rescan:")
|
||||
}
|
||||
this.scheduleRescan(RescanReason.PERIODIC);
|
||||
}
|
||||
return;
|
||||
@ -229,12 +228,11 @@ class PageInfo {
|
||||
|
||||
var ths = this;
|
||||
|
||||
|
||||
this.rescanTimer = setTimeout(function(rr){
|
||||
this.rescanTimer = setTimeout(function(rescanReason){
|
||||
ths.rescanTimer = null;
|
||||
ths.rescan(rr);
|
||||
ths.rescan(rescanReason);
|
||||
ths = null;
|
||||
}, rescanReason === this.settings.active.pageInfo.timeouts.rescan, RescanReason.PERIODIC)
|
||||
}, this.settings.active.pageInfo.timeouts.rescan, RescanReason.PERIODIC)
|
||||
} catch(e) {
|
||||
if(Debug.debug){
|
||||
console.log("[PageInfo::scheduleRescan] scheduling rescan failed. Here's why:",e)
|
||||
@ -255,16 +253,16 @@ class PageInfo {
|
||||
ths.ghettoUrlCheck();
|
||||
ths = null;
|
||||
}, this.settings.active.pageInfo.timeouts.urlCheck)
|
||||
}catch(e){
|
||||
} catch(e){
|
||||
if(Debug.debug){
|
||||
console.log("[PageInfo::scheduleUrlCheck] scheduling URL check failed. Here's why:",e)
|
||||
console.error("[PageInfo::scheduleUrlCheck] scheduling URL check failed. Here's why:",e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ghettoUrlCheck() {
|
||||
if (this.lastUrl != window.location.href){
|
||||
if(Debug.debug){
|
||||
if(Debug.debug && Debug.periodic){
|
||||
console.log("[PageInfo::ghettoUrlCheck] URL has changed. Triggering a rescan!");
|
||||
}
|
||||
|
||||
|
@ -225,8 +225,8 @@ class PlayerData {
|
||||
}
|
||||
|
||||
collectionHas(collection, element) {
|
||||
for (let i = 0, len = a.length; i < len; i++) {
|
||||
if (a[i] == b) {
|
||||
for (let i = 0, len = collection.length; i < len; i++) {
|
||||
if (collection[i] == element) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user