From d63197b13ad398da4148f62289b1e08ca05905ae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 15 Mar 2020 16:31:13 +0000 Subject: [PATCH 01/15] Bump acorn from 6.4.0 to 6.4.1 Bumps [acorn](https://github.com/acornjs/acorn) from 6.4.0 to 6.4.1. - [Release notes](https://github.com/acornjs/acorn/releases) - [Commits](https://github.com/acornjs/acorn/compare/6.4.0...6.4.1) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index b39c11a..fe9a161 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1368,9 +1368,9 @@ "dev": true }, "acorn": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.0.tgz", - "integrity": "sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", + "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", "dev": true }, "ajv": { From 7c80da3b5aa171085fba58219cf3b20dbbac4f8b Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sun, 22 Mar 2020 02:43:45 +0100 Subject: [PATCH 02/15] add ms certification notes --- MSS-CERTIFICATION-NOTES.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 MSS-CERTIFICATION-NOTES.md diff --git a/MSS-CERTIFICATION-NOTES.md b/MSS-CERTIFICATION-NOTES.md new file mode 100644 index 0000000..677a6b3 --- /dev/null +++ b/MSS-CERTIFICATION-NOTES.md @@ -0,0 +1,23 @@ +Microsoft edge extension store requires notes for certification. Because I'm too lazy to whip this text over and over and over and over and over and over again, I'm making it a copypasta. + + +--------------------------------------------------------------------------------------------- +This extension is targeted at users of 21:9 monitors. If using 16:9 monitor, use youtube in THEATER MODE. + +Not all videos need to have their aspect ratio corrected. Here is few examples of videos with problems this extension is trying to solve: + +* Variable aspect ratio — autodetection testing grounds: https://www.youtube.com/watch?v=-IHzprfs6tw +* Static (but incorrect) aspect ratio: https://www.youtube.com/watch?v=BTETsm79D3A + +Twitch example (collapse subscription & chat sidebars on 16:9, do not fullscreen) — aspect ratio switch happens at around 1:50:00 mark: +* https://www.twitch.tv/videos/330639009?t=1h49m45s + +Autodetect has technological limitations and can incorrectly detect aspect ratio. This is acceptable — user should override it in such cases. + +Functions labelled 'experimental' are experimental and may not function correctly. + +Websites may interfere with keyboard shortcuts. + +Brief video flicker when changing between fullscreen, non-fullscreen or when changing browser is inherent artifact caused by sites not being aware of extension and is thus considered acceptable. + +Logger option does nothing (except give you a popup) unless you have a logger config handy. It is designed for debugging in case of bug reports. \ No newline at end of file From 44eef78d29296cdb6e1ac416efac6b6315feedb6 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Mon, 13 Apr 2020 14:31:01 +0200 Subject: [PATCH 03/15] whitespace removal --- src/manifest.json | 1 - 1 file changed, 1 deletion(-) diff --git a/src/manifest.json b/src/manifest.json index c2d3fab..802449c 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -46,7 +46,6 @@ "ext/*", "res/fonts/*", "res/css/*", - "res/img/settings/about-bg.png" ], "permissions": [ From ff525f159b4f676abcd24f23ba0fa89a41fa9c29 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Mon, 13 Apr 2020 14:35:04 +0200 Subject: [PATCH 04/15] try rescoping --- src/csui/LoggerUi.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/csui/LoggerUi.vue b/src/csui/LoggerUi.vue index 5ef210d..023d790 100644 --- a/src/csui/LoggerUi.vue +++ b/src/csui/LoggerUi.vue @@ -296,7 +296,7 @@ export default { } - + + diff --git a/src/common/components/JsonEditor/JsonElement.vue b/src/common/components/JsonEditor/JsonElement.vue index 592582d..dfd38ec 100644 --- a/src/common/components/JsonEditor/JsonElement.vue +++ b/src/common/components/JsonEditor/JsonElement.vue @@ -86,6 +86,5 @@ export default { } - diff --git a/src/common/components/JsonEditor/JsonObject.vue b/src/common/components/JsonEditor/JsonObject.vue index 11ef46f..9797c02 100644 --- a/src/common/components/JsonEditor/JsonObject.vue +++ b/src/common/components/JsonEditor/JsonObject.vue @@ -87,6 +87,5 @@ export default { } - \ No newline at end of file From dfdc26fe2b613e025265949d7f6a9a58330e04ab Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Tue, 28 Apr 2020 00:35:41 +0200 Subject: [PATCH 07/15] fix font imports --- src/res/css/common.scss | 3 +- src/res/css/font/overpass-mono.css | 29 --- src/res/css/fonts.scss | 111 ++++++++++ .../overpass-mono-webfont/overpass-mono.css | 51 ----- src/res/fonts/overpass-webfont/overpass.css | 189 ------------------ 5 files changed, 112 insertions(+), 271 deletions(-) create mode 100644 src/res/css/fonts.scss delete mode 100644 src/res/fonts/overpass-mono-webfont/overpass-mono.css delete mode 100644 src/res/fonts/overpass-webfont/overpass.css diff --git a/src/res/css/common.scss b/src/res/css/common.scss index 25bac41..33458a1 100644 --- a/src/res/css/common.scss +++ b/src/res/css/common.scss @@ -1,6 +1,5 @@ @import "colors.scss"; -@import "/res/css/font/overpass.css"; -@import "/res/css/font/overpass-mono.css"; +@import "fonts.scss"; @import "flex.scss"; // @import "form.scss"; diff --git a/src/res/css/font/overpass-mono.css b/src/res/css/font/overpass-mono.css index c751e5e..e69de29 100644 --- a/src/res/css/font/overpass-mono.css +++ b/src/res/css/font/overpass-mono.css @@ -1,29 +0,0 @@ -@font-face { - font-family: 'overpass-mono'; - src: url('../../fonts/overpass-mono-webfont/overpass-mono-light.woff2') format('woff2'); - font-weight: 300; - font-style: normal; -} - -@font-face { - font-family: 'overpass-mono'; - src: url('../../fonts/overpass-mono-webfont/overpass-mono-regular.woff2') format('woff2'); - font-weight: 400; - font-style: normal; -} - -@font-face { - font-family: 'overpass-mono'; - src: url('../../fonts/overpass-mono-webfont/overpass-mono-semibold.woff2') format('woff2'); - font-weight: 500; - font-style: normal; -} - - - -@font-face { - font-family: 'overpass-mono'; - src: url('../../fonts/overpass-mono-webfont/overpass-mono-bold.woff2') format('woff2'); - font-weight: 600; - font-style: normal; -} diff --git a/src/res/css/fonts.scss b/src/res/css/fonts.scss new file mode 100644 index 0000000..5c50ef2 --- /dev/null +++ b/src/res/css/fonts.scss @@ -0,0 +1,111 @@ +@font-face { + font-family: 'Overpass'; + src: url('/res/fonts/overpass-webfont/overpass-thin.woff2') format('woff2'); /* Super Modern Browsers */ + font-weight: 200; + font-style: normal; +} + +@font-face { + font-family: 'Overpass'; + src: url('/res/fonts/overpass-webfont/overpass-thin-italic.woff2') format('woff2'); + font-weight: 200; + font-style: italic; +} + +@font-face { + font-family: 'Overpass'; + src: url('/res/fonts/overpass-webfont/overpass-extralight.woff2') format('woff2'); + font-weight: 300; + font-style: normal; +} + +@font-face { + font-family: 'Overpass'; + src: url('/res/fonts/overpass-webfont/overpass-extralight-italic.woff2') format('woff2'); + font-weight: 300; + font-style: italic; +} + +@font-face { + font-family: 'Overpass'; + src: url('/res/fonts/overpass-webfont/overpass-light.woff2') format('woff2'); + font-weight: 400; + font-style: normal; +} + +@font-face { + font-family: 'Overpass'; + src: url('/res/fonts/overpass-webfont/overpass-light-italic.woff2') format('woff2'); + font-weight: 400; + font-style: italic; +} + +@font-face { + font-family: 'Overpass'; + src: url('/res/fonts/overpass-webfont/overpass-regular.woff2') format('woff2'); + font-weight: 500; + font-style: normal; +} + +@font-face { + font-family: 'Overpass'; + src: url('/res/fonts/overpass-webfont/overpass-italic.woff2') format('woff2'); + font-weight: 500; + font-style: italic; +} + +@font-face { + font-family: 'Overpass'; + src: url('/res/fonts/overpass-webfont/overpass-semibold.woff2') format('woff2'); + font-weight: 600; + font-style: normal; +} + +@font-face { + font-family: 'Overpass'; + src: url('/res/fonts/overpass-webfont/overpass-semibold-italic.woff2') format('woff2'); + font-weight: 600; + font-style: italic; +} + +@font-face { + font-family: 'Overpass'; + src: url('/res/fonts/overpass-webfont/overpass-bold.woff2') format('woff2'); + font-weight: 700; + font-style: normal; +} + +@font-face { + font-family: 'Overpass'; + src: url('/res/fonts/overpass-webfont/overpass-bold-italic.woff2') format('woff2'); + font-weight: 700; + font-style: italic; +} + +@font-face { + font-family: 'Overpass mono'; + src: url('/res/fonts/overpass-mono-webfont/overpass-mono-light.woff2') format('woff2'); + font-weight: 300; + font-style: normal; +} + +@font-face { + font-family: 'Overpass mono'; + src: url('/res/fonts/overpass-mono-webfont/overpass-mono-regular.woff2') format('woff2'); + font-weight: 400; + font-style: normal; +} + +@font-face { + font-family: 'Overpass mono'; + src: url('/res/fonts/overpass-mono-webfont/overpass-mono-semibold.woff2') format('woff2'); + font-weight: 500; + font-style: normal; +} + +@font-face { + font-family: 'Overpass mono'; + src: url('/res/fonts/overpass-mono-webfont/overpass-mono-bold.woff2') format('woff2'); + font-weight: 600; + font-style: normal; +} diff --git a/src/res/fonts/overpass-mono-webfont/overpass-mono.css b/src/res/fonts/overpass-mono-webfont/overpass-mono.css deleted file mode 100644 index d380209..0000000 --- a/src/res/fonts/overpass-mono-webfont/overpass-mono.css +++ /dev/null @@ -1,51 +0,0 @@ - - -@font-face { - font-family: 'overpass-mono'; - src: url('overpass-mono-light.eot'); - src: url('overpass-mono-light.eot?#iefix') format('embedded-opentype'), - url('overpass-mono-light.woff2') format('woff2'), - url('overpass-mono-light.woff') format('woff'), - url('overpass-mono-light.ttf') format('truetype'); - font-weight: 300; - font-style: normal; -} - - - -@font-face { - font-family: 'overpass-mono'; - src: url('overpass-mono-regular.eot'); - src: url('overpass-mono-regular.eot?#iefix') format('embedded-opentype'), - url('overpass-mono-regular.woff2') format('woff2'), - url('overpass-mono-regular.woff') format('woff'), - url('overpass-mono-regular.ttf') format('truetype'); - font-weight: 400; - font-style: normal; -} - - - -@font-face { - font-family: 'overpass-mono'; - src: url('overpass-mono-semibold.eot'); - src: url('overpass-mono-semibold.eot?#iefix') format('embedded-opentype'), - url('overpass-mono-semibold.woff2') format('woff2'), - url('overpass-mono-semibold.woff') format('woff'), - url('overpass-mono-semibold.ttf') format('truetype'); - font-weight: 500; - font-style: normal; -} - - - -@font-face { - font-family: 'overpass-mono'; - src: url('overpass-mono-bold.eot'); - src: url('overpass-mono-bold.eot?#iefix') format('embedded-opentype'), - url('overpass-mono-bold.woff2') format('woff2'), - url('overpass-mono-bold.woff') format('woff'), - url('overpass-mono-bold.ttf') format('truetype'); - font-weight: 600; - font-style: normal; -} diff --git a/src/res/fonts/overpass-webfont/overpass.css b/src/res/fonts/overpass-webfont/overpass.css deleted file mode 100644 index 356c985..0000000 --- a/src/res/fonts/overpass-webfont/overpass.css +++ /dev/null @@ -1,189 +0,0 @@ -@font-face { - font-family: 'overpass'; - src: url('overpass-thin.eot'); /* IE9 Compat Modes */ - src: url('overpass-thin.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('overpass-thin.woff2') format('woff2'), /* Super Modern Browsers */ - url('overpass-thin.woff') format('woff'), /* Pretty Modern Browsers */ - url('overpass-thin.ttf') format('truetype'); /* Safari, Android, iOS */ - font-weight: 200; - font-style: normal; -} - -@font-face { - font-family: 'overpass'; - src: url('overpass-thin-italic.eot'); - src: url('overpass-thin-italic.eot?#iefix') format('embedded-opentype'), - url('overpass-thin-italic.woff2') format('woff2'), - url('overpass-thin-italic.woff') format('woff'), - url('overpass-thin-italic.ttf') format('truetype'); - font-weight: 200; - font-style: italic; -} - - -@font-face { - font-family: 'overpass'; - src: url('overpass-extralight.eot'); - src: url('overpass-extralight.eot?#iefix') format('embedded-opentype'), - url('overpass-extralight.woff2') format('woff2'), - url('overpass-extralight.woff') format('woff'), - url('overpass-extralight.ttf') format('truetype'); - font-weight: 300; - font-style: normal; -} - -@font-face { - font-family: 'overpass'; - src: url('overpass-extralight-italic.eot'); - src: url('overpass-extralight-italic.eot?#iefix') format('embedded-opentype'), - url('overpass-extralight-italic.woff2') format('woff2'), - url('overpass-extralight-italic.woff') format('woff'), - url('overpass-extralight-italic.ttf') format('truetype'); - font-weight: 300; - font-style: italic; -} - - - -@font-face { - font-family: 'overpass'; - src: url('overpass-light.eot'); - src: url('overpass-light.eot?#iefix') format('embedded-opentype'), - url('overpass-light.woff2') format('woff2'), - url('overpass-light.woff') format('woff'), - url('overpass-light.ttf') format('truetype'); - font-weight: 400; - font-style: normal; -} - -@font-face { - font-family: 'overpass'; - src: url('overpass-light-italic.eot'); - src: url('overpass-light-italic.eot?#iefix') format('embedded-opentype'), - url('overpass-light-italic.woff2') format('woff2'), - url('overpass-light-italic.woff') format('woff'), - url('overpass-light-italic.ttf') format('truetype'); - font-weight: 400; - font-style: italic; -} - - - -@font-face { - font-family: 'overpass'; - src: url('overpass-regular.eot'); - src: url('overpass-regular.eot?#iefix') format('embedded-opentype'), - url('overpass-regular.woff2') format('woff2'), - url('overpass-regular.woff') format('woff'), - url('overpass-regular.ttf') format('truetype'); - font-weight: 500; - font-style: normal; -} - -@font-face { - font-family: 'overpass'; - src: url('overpass-italic.eot'); - src: url('overpass-italic.eot?#iefix') format('embedded-opentype'), - url('overpass-italic.woff2') format('woff2'), - url('overpass-italic.woff') format('woff'), - url('overpass-italic.ttf') format('truetype'); - font-weight: 500; - font-style: italic; -} - - - - -@font-face { - font-family: 'overpass'; - src: url('overpass-semibold.eot'); - src: url('overpass-semibold.eot?#iefix') format('embedded-opentype'), - url('overpass-semibold.woff2') format('woff2'), - url('overpass-semibold.woff') format('woff'), - url('overpass-semibold.ttf') format('truetype'); - font-weight: 600; - font-style: normal; -} - -@font-face { - font-family: 'overpass'; - src: url('overpass-semibold-italic.eot'); - src: url('overpass-semibold-italic.eot?#iefix') format('embedded-opentype'), - url('overpass-semibold-italic.woff2') format('woff2'), - url('overpass-semibold-italic.woff') format('woff'), - url('overpass-semibold-italic.ttf') format('truetype'); - font-weight: 600; - font-style: italic; -} - - - - -@font-face { - font-family: 'overpass'; - src: url('overpass-bold.eot'); - src: url('overpass-bold.eot?#iefix') format('embedded-opentype'), - url('overpass-bold.woff2') format('woff2'), - url('overpass-bold.woff') format('woff'), - url('overpass-bold.ttf') format('truetype'); - font-weight: 700; - font-style: normal; -} - -@font-face { - font-family: 'overpass'; - src: url('overpass-bold-italic.eot'); - src: url('overpass-bold-italic.eot?#iefix') format('embedded-opentype'), - url('overpass-bold-italic.woff2') format('woff2'), - url('overpass-bold-italic.woff') format('woff'), - url('overpass-bold-italic.ttf') format('truetype'); - font-weight: 700; - font-style: italic; -} - - - -@font-face { - font-family: 'overpass'; - src: url('overpass-extrabold.eot'); - src: url('overpass-extrabold.eot?#iefix') format('embedded-opentype'), - url('overpass-extrabold.woff2') format('woff2'), - url('overpass-extrabold.woff') format('woff'), - url('overpass-extrabold.ttf') format('truetype'); - font-weight: 800; - font-style: normal; -} - -@font-face { - font-family: 'overpass'; - src: url('overpass-extrabold-italic.eot'); - src: url('overpass-extrabold-italic.eot?#iefix') format('embedded-opentype'), - url('overpass-extrabold-italic.woff2') format('woff2'), - url('overpass-extrabold-italic.woff') format('woff'), - url('overpass-extrabold-italic.ttf') format('truetype'); - font-weight: 800; - font-style: italic; -} - - -@font-face { - font-family: 'overpass'; - src: url('overpass-heavy.eot'); - src: url('overpass-heavy.eot?#iefix') format('embedded-opentype'), - url('overpass-heavy.woff2') format('woff2'), - url('overpass-heavy.woff') format('woff'), - url('overpass-heavy.ttf') format('truetype'); - font-weight: 900; - font-style: normal; -} - -@font-face { - font-family: 'overpass'; - src: url('overpass-heavy-italic.eot'); - src: url('overpass-heavy-italic.eot?#iefix') format('embedded-opentype'), - url('overpass-heavy-italic.woff2') format('woff2'), - url('overpass-heavy-italic.woff') format('woff'), - url('overpass-heavy-italic.ttf') format('truetype'); - font-weight: 900; - font-style: italic; -} From 10f1bae7de7257e18a2c6deb7c8184f9154f199e Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Tue, 28 Apr 2020 03:04:15 +0200 Subject: [PATCH 08/15] move sleep function to a separate fire --- src/ext/lib/Util.js | 3 +++ src/ext/lib/ar-detect/ArDetector.js | 8 +++----- 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 src/ext/lib/Util.js diff --git a/src/ext/lib/Util.js b/src/ext/lib/Util.js new file mode 100644 index 0000000..51b48a3 --- /dev/null +++ b/src/ext/lib/Util.js @@ -0,0 +1,3 @@ +export async function sleep(timeout) { + return new Promise( (resolve, reject) => setTimeout(() => resolve(), timeout)); +} diff --git a/src/ext/lib/ar-detect/ArDetector.js b/src/ext/lib/ar-detect/ArDetector.js index 3c05561..4af5875 100644 --- a/src/ext/lib/ar-detect/ArDetector.js +++ b/src/ext/lib/ar-detect/ArDetector.js @@ -8,6 +8,7 @@ import GuardLine from './GuardLine'; // import DebugCanvas from './DebugCanvas'; import VideoAlignment from '../../../common/enums/video-alignment.enum'; import AspectRatio from '../../../common/enums/aspect-ratio.enum'; +import {sleep} from '../../lib/Util'; class ArDetector { @@ -257,7 +258,7 @@ class ArDetector { while (!this._exited && exitedRetries --> 0) { this.logger.log('warn', 'debug', `[ArDetect::main] <@${this.arid}> We are trying to start another instance of autodetection on current video, but the previous instance hasn't exited yet. Waiting for old instance to exit ...`); - await this.sleep(this.settings.active.arDetect.timers.tickrate); + await sleep(this.settings.active.arDetect.timers.tickrate); } if (!this._exited) { this.logger.log('error', 'debug', `[ArDetect::main] <@${this.arid}> Previous instance didn't exit in time. Not starting a new one.`); @@ -302,16 +303,13 @@ class ArDetector { } } - await this.sleep(this.settings.active.arDetect.timers.tickrate); + await sleep(this.settings.active.arDetect.timers.tickrate); } this.logger.log('info', 'debug', `%c[ArDetect::main] <@${this.arid}> Main autodetection loop exited. Halted? ${this._halted}`, _ard_console_stop); this._exited = true; } - async sleep(timeout) { - return new Promise( (resolve, reject) => setTimeout(() => resolve(), timeout)); - } canTriggerFrameCheck(lastFrameCheckStartTime) { if (this._paused) { From ccde079aeeb8bec1e8b129b6c1807acea40ec297 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Tue, 28 Apr 2020 03:05:55 +0200 Subject: [PATCH 09/15] If video dimensions are invalid, wait a little and check again before performing the crop calculation --- src/ext/lib/video-transform/Resizer.js | 40 ++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/src/ext/lib/video-transform/Resizer.js b/src/ext/lib/video-transform/Resizer.js index 849d4cb..c28e9ef 100644 --- a/src/ext/lib/video-transform/Resizer.js +++ b/src/ext/lib/video-transform/Resizer.js @@ -8,6 +8,7 @@ import Stretch from '../../../common/enums/stretch.enum'; import VideoAlignment from '../../../common/enums/video-alignment.enum'; import AspectRatio from '../../../common/enums/aspect-ratio.enum'; import CropModePersistance from '../../../common/enums/crop-mode-persistence.enum'; +import { sleep } from '../Util'; if(Debug.debug) { console.log("Loading: Resizer.js"); @@ -139,7 +140,7 @@ class Resizer { } } - setAr(ar, lastAr) { + async setAr(ar, lastAr) { if (this.destroyed) { return; } @@ -258,15 +259,37 @@ class Resizer { || this.stretcher.mode === Stretch.FixedSource){ var stretchFactors = this.scaler.calculateCrop(ar); + this.logger.log('error', 'debug', `[Resizer::setAr] failed to set AR due to problem with calculating crop. Error:`, stretchFactors && stretchFactors.error); + if(! stretchFactors || stretchFactors.error){ - this.logger.log('error', 'debug', `[Resizer::setAr] failed to set AR due to problem with calculating crop. Error:`, (stretchFactors ? stretchFactors.error : stretchFactors)); - if (stretchFactors.error === 'no_video'){ + if (stretchFactors?.error === 'no_video'){ this.conf.destroy(); + return; } - if (stretchFactors.error === 'illegal_video_dimensions') { - this.logger.log('error', 'debug', `[Resizer::setAr] Illegal video dimensions found. We will pause everything.`) + + // we could have issued calculate crop too early. Instead of spending 30 minutes trying to fix this the proper way by + // reading documentation, let's fix it in 30 seconds with some brute force code + if (stretchFactors?.error === 'illegal_video_dimensions') { + let timeout = 10; // ms + let iteration = 0; + let maxIterations = 6; + do { + if (iteration > maxIterations) { + this.logger.log('error', 'debug', `[Resizer::setAr] Video dimensions remain illegal after ${maxIterations} retries`); + return; + } + // fire first few rechecks in quick succession, but start increasing timeout + // later down the line. + if (iteration > 3) { + timeout *= 2; + } + this.logger.log('info', 'debug', `[Resizer::setAr] Sleeping for ${timeout} ms`); + await sleep(timeout); + stretchFactors = this.scaler.calculateCrop(ar); + iteration++; + } while (stretchFactors.error === 'illegal_video_dimensions'); + this.logger.log('info', 'debug', `[Resizer::setAr] Video dimensions have corrected themselves after retrying.`); } - return; } if (this.stretcher.mode === Stretch.Conditional){ @@ -589,12 +612,17 @@ class Resizer { // inject new CSS or replace existing one if (!this.userCss) { + this.logger.log('info', ['debug', 'resizer'], "[Resizer::setStyleString] Setting new css: ", newCssString); + this.injectCss(newCssString); this.userCss = newCssString; } else if (newCssString !== this.userCss) { + this.logger.log('info', ['debug', 'resizer'], "[Resizer::setStyleString] Replacing css.\nOld string:", this.userCss, "\nNew string:", newCssString); // we only replace css if it this.replaceCss(this.userCss, newCssString); this.userCss = newCssString; + } else { + this.logger.log('info', ['debug', 'resizer'], "[Resizer::setStyleString] Existing css is still valid, doing nothing."); } } } From 103ecf7a83d2abbd7b8ce4efe4b5a60c097a06ae Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Wed, 29 Apr 2020 22:55:20 +0200 Subject: [PATCH 10/15] Version update stuff --- CHANGELOG.md | 4 +++- src/popup/panels/WhatsNewPanel.vue | 25 ++++--------------------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 098de7c..9b9d6cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,10 +13,12 @@ QoL improvements for me: * logging: allow to enable logging at will and export said logs to a file -### v4.4.7 (current) +### v4.4.7 (Current) * Removed unnecessary font files and image files from the package. * LoggerUI is now functional. +* **[4.4.7.1]** Additional CSS fixes +* **[4.4.7.1]** Bruteforce fix for youtube alignment issue ### v4.4.6 diff --git a/src/popup/panels/WhatsNewPanel.vue b/src/popup/panels/WhatsNewPanel.vue index 4ae6384..3ee98f0 100644 --- a/src/popup/panels/WhatsNewPanel.vue +++ b/src/popup/panels/WhatsNewPanel.vue @@ -4,30 +4,13 @@

Full changelog for older versions is available here.

4.4.7

    +
  • [4.4.7.1] CSS fixes
  • +
  • [4.4.7.1] Delay CSS changes if video dimensions are invalid (attempt to fix youtube alignment problems + that appear in certain circumstances) +
  • Removed unnecessary font files and image files from the package.
  • (For testing/debugging purposes) Logger UI in swatter mode is now somewhat functional and user-friendly.
- -