diff --git a/README.md b/README.md index 8edd3ca..2872fa4 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,10 @@ Manually triggering aspect ratio change will suspend automatic aspect ratio dete ## Changelog +### v2.1.3 + +* Youtube pushed an update that broke this extension on Firefox (but not on Chrome?). This update fixes it. + ### v2.1.2 * Fixed some bugs with autodetection sometimes not working properly on Youtube. @@ -162,7 +166,7 @@ Furthermore, triggering UI re-initialisation on onUpdated events turned out to n This is why Netflix uses another function that manually checks whether the player bar is present. Ideally that check happens every tenth of a second, but Firefox may be limiting that to one per second. -###v1.0.2 +### v1.0.2 The 'extension sometimes not working' bug was fixed (by having extension try to setup every time a page got updated), but the fix had some problems. Namely, the extension would re-initiate (complete with re-adding the entire UI) itself very _very_ often. diff --git a/js/conf/Debug.js b/js/conf/Debug.js index 2c647c0..6cb96c2 100644 --- a/js/conf/Debug.js +++ b/js/conf/Debug.js @@ -10,6 +10,7 @@ Debug = { debugStorage: true, showArDetectCanvas: true, flushStoredSettings: false, + playerDetectDebug: false arDetect: { edgeDetect: true } diff --git a/js/conf/Settings.js b/js/conf/Settings.js index 2b5e3bc..a565ebd 100644 --- a/js/conf/Settings.js +++ b/js/conf/Settings.js @@ -14,6 +14,8 @@ var _se_init = async function(neverFlushStored){ var newSettings = await StorageManager.getopt_async("uw-settings"); + var uwVersion = browser.runtime.getManifest().version; + if (Debug.debug) console.log("[Settings::_se_init()] settings saved in localstorage are:", newSettings, " - if that's empty, it's gonna be replaced by this:", JSON.stringify(this), ")"); @@ -23,6 +25,10 @@ var _se_init = async function(neverFlushStored){ } else{ var actualSettings = JSON.parse(newSettings["uw-settings"]); + if(actualSettings.version === undefined || actualSettings.version != uwVersion){ + console.log("[Settings::_se_init()] extension was updated, replacing settings"); + StorageManager.setopt({"uw-settings": JSON.stringify(this)}); + } if(Debug.debug) console.log("[Settings::_se_init()] parsed settings:", actualSettings); diff --git a/js/lib/PlayerDetect.js b/js/lib/PlayerDetect.js index 13e4b74..a451211 100644 --- a/js/lib/PlayerDetect.js +++ b/js/lib/PlayerDetect.js @@ -47,7 +47,8 @@ var _pd_getPlayerDimensions = function(element){ return; } var playerCandidateNode = element; - + var trustCandidateAfterGrows = 2; // if candidate_width or candidate_height increases in either dimensions this many + // times, we say we found our player. (This number ignores weird elements) // in case our