From 2c0f0ed607270a218d0fff8c00ab6107987161a3 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sun, 4 Feb 2018 17:39:26 +0100 Subject: [PATCH] Release v2.1.0 (sans readme) --- js/conf/Debug.js | 4 ++-- js/conf/Settings.js | 10 ++++++++++ js/lib/PlayerDetect.js | 7 ++++++- js/modules/Resizer.js | 20 ++++++++++++++++---- js/uw-bg.js | 16 ++++++++++++++++ js/uw.js | 32 ++++++++++++-------------------- res/popup/js/popup.js | 8 +++----- res/popup/popup.html | 4 ++-- 8 files changed, 67 insertions(+), 34 deletions(-) diff --git a/js/conf/Debug.js b/js/conf/Debug.js index aa4de47..a93499c 100644 --- a/js/conf/Debug.js +++ b/js/conf/Debug.js @@ -1,6 +1,6 @@ // Set prod to true when releasing -// _prod = true; -_prod = false; +_prod = true; +// _prod = false; Debug = { debug: true, diff --git a/js/conf/Settings.js b/js/conf/Settings.js index 16b426e..acb4bed 100644 --- a/js/conf/Settings.js +++ b/js/conf/Settings.js @@ -54,6 +54,14 @@ var _se_reload = function(){ this.init(true); } +var _se_isBlacklisted = function(site){ + return this.blacklist.indexOf(site) > -1; +} + +var _se_isWhitelisted = function(site){ + return this.whitelist.indexOf(site) > -1; +} + var Settings = { arDetect: { enabled: "global", // thats my csgo rank kappa @@ -81,6 +89,8 @@ var Settings = { }, whitelist: [], blacklist: ["vimeo.com"], + isBlacklisted: _se_isBlacklisted, + isWhitelisted: _se_isWhitelisted, init: _se_init, save: _se_save, reload: _se_reload, diff --git a/js/lib/PlayerDetect.js b/js/lib/PlayerDetect.js index f2cda9a..13e4b74 100644 --- a/js/lib/PlayerDetect.js +++ b/js/lib/PlayerDetect.js @@ -40,7 +40,12 @@ var _pd_getPlayerDimensions = function(element){ height: screen.height }; } - + if(element == null){ + if(Debug.debug) + console.log("[PlayerDetect::_pd_getPlayerDimensions] element is not valid, doing nothing.", element) + + return; + } var playerCandidateNode = element; // in case our