From 9265a336bc4b04b52f86ca3b2867bd1717026c9d Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Thu, 18 Jan 2018 00:11:03 +0100 Subject: [PATCH] Trying to add blanket support for theater mode. Changing aspect ratio works in youtube theater mode, but only when manually launched. Chaning to full screen mode stops it. This commit breaks vimeo support. --- js/conf/Debug.js | 6 +-- js/lib/BrowserDetect.js | 2 +- js/lib/Comms.js | 2 +- js/lib/PlayerDetect.js | 82 ++++++++++++++++++++++++++++ js/modules/ArDetect.js | 24 ++++----- js/modules/Resizer.js | 110 ++++++-------------------------------- js/uw.js | 17 +++--- manifest-chrome.json~HEAD | 73 +++++++++++++++++++++++++ manifest-ff.json | 72 +++++++++++++++++++++++++ manifest.json | 78 ++++++++++++++------------- res/popup/js/popup.js | 4 +- res/popup/popup.html | 1 + 12 files changed, 314 insertions(+), 157 deletions(-) create mode 100644 js/lib/PlayerDetect.js create mode 100644 manifest-chrome.json~HEAD create mode 100644 manifest-ff.json diff --git a/js/conf/Debug.js b/js/conf/Debug.js index 3bd9aa4..a95f98f 100644 --- a/js/conf/Debug.js +++ b/js/conf/Debug.js @@ -1,12 +1,12 @@ // Set prod to true when releasing -_prod = true; -//_prod = false; +// _prod = true; +_prod = false; Debug = { debug: true, keyboard: true, debugResizer: true, - debugArDetect: true, + debugArDetect: false, debugStorage: true, showArDetectCanvas: false, flushStoredSettings: true diff --git a/js/lib/BrowserDetect.js b/js/lib/BrowserDetect.js index bd39c58..8a5922e 100644 --- a/js/lib/BrowserDetect.js +++ b/js/lib/BrowserDetect.js @@ -16,7 +16,7 @@ catch (e) {}; if(typeof browser === "undefined"){ // This is a good sign we're in chrome or chromium-based browsers if(chrome){ browser = chrome; - _bd_usebrowser = "chrome; + _bd_usebrowser = "chrome"; _bd_isChrome = true; _bd_isEdge = false; } diff --git a/js/lib/Comms.js b/js/lib/Comms.js index 00e98ef..8bab757 100644 --- a/js/lib/Comms.js +++ b/js/lib/Comms.js @@ -1,7 +1,7 @@ var _com_chrome_tabquery_wrapper = async function(tabInfo){ return new Promise(function (resolve, reject){ browser.tabs.query(tabInfo, function(response){ - + browser.tabs.query(tabInfo); // Chrome/js shittiness mitigation — remove this line and an empty array will be returned var r = response; resolve(r); diff --git a/js/lib/PlayerDetect.js b/js/lib/PlayerDetect.js new file mode 100644 index 0000000..c59bcb9 --- /dev/null +++ b/js/lib/PlayerDetect.js @@ -0,0 +1,82 @@ + +/* sprejme