diff --git a/src/ext/lib/Settings.js b/src/ext/lib/Settings.js index 5f0e904..bcca4db 100644 --- a/src/ext/lib/Settings.js +++ b/src/ext/lib/Settings.js @@ -76,7 +76,9 @@ class Settings { async init() { const settings = await this.get(); - const oldVersion = settings.version; + + // |—> on first setup, settings is undefined & settings.version is haram + const oldVersion = (settings && settings.version) || '0.0.0'; const currentVersion = this.getExtensionVersion(); if(Debug.debug) { diff --git a/src/ext/lib/ar-detect/ArDetector.js b/src/ext/lib/ar-detect/ArDetector.js index 8a35f14..bac7b2d 100644 --- a/src/ext/lib/ar-detect/ArDetector.js +++ b/src/ext/lib/ar-detect/ArDetector.js @@ -1,3 +1,4 @@ + import Debug from '../../conf/Debug'; import EdgeDetect from './edge-detect/EdgeDetect'; import EdgeStatus from './edge-detect/enums/EdgeStatusEnum'; @@ -221,16 +222,22 @@ class ArDetector { this.conf.resizer.setLastAr({type: AspectRatio.Automatic, ratio: this.getDefaultAr()}); } + + // launch main() if it's currently not running: this.main(); + // automatic detection starts halted. If halted=false when main first starts, extension won't run + // this._paused is undefined the first time we run this function, which is effectively the same thing + // as false. Still, we'll explicitly fix this here. + this._paused = false; this._halted = false; - this._paused = false; - } unpause() { - if(this._paused){ // resume only if we explicitly paused - this.start(); + // pause only if we were running before. Don't pause if we aren't running + // (we are running when _halted is neither true nor undefined) + if (this._paused && this._halted === false) { + this._paused = true; } } @@ -251,12 +258,14 @@ class ArDetector { } async main() { - if (this.paused) { + if (this._paused) { // unpause if paused this._paused = false; + return; // main loop still keeps executing. Return is needed to avoid a million instances of autodetection } if (!this._halted) { // we are already running, don't run twice + // this would have handled the 'paused' from before, actually. return; } @@ -794,12 +803,6 @@ class ArDetector { this.guardline.reset(); this.conf.resizer.setAr({type: AspectRatio.Automatic, ratio: this.getDefaultAr()}); } - - // } - // else{ - // console.log("detected text on edges, dooing nothing") - // } - } resetBlackLevel(){ diff --git a/src/manifest.json b/src/manifest.json index e27fbf6..cbe47f3 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "Ultrawidify", "description": "Removes black bars on ultrawide videos and offers advanced options to fix aspect ratio.", - "version": "4.2.3.1", + "version": "4.2.3.3", "applications": { "gecko": { "id": "{cf02b1a7-a01a-4e37-a609-516a283f1ed3}" diff --git a/src/popup/panels/WhatsNewPanel.vue b/src/popup/panels/WhatsNewPanel.vue index b8bf65f..17daf47 100644 --- a/src/popup/panels/WhatsNewPanel.vue +++ b/src/popup/panels/WhatsNewPanel.vue @@ -2,13 +2,15 @@

What's new

Full changelog for older versions is available here.

-

4.2.3[.1]

+

4.2.3[.x]

As you can tell, I don't leave reddit and youtube much. To be fair, the twitching issue was intermittent on twitch.

Chrome users: as a result of Chrome's shortcomings, there now exists one potential performance issue.