From b2f6a1fdddad9e62aeb11fa3ead83ca115214347 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sat, 2 Nov 2019 21:58:55 +0100 Subject: [PATCH 01/10] Auto-collect extension/browser info in mailto/reddit compose links (and hopefully fix them) --- src/ext/conf/BrowserDetect.js | 1 + src/options/about.vue | 27 +++++++++++++++++++++++++-- src/popup/panels/AboutPanel.vue | 27 +++++++++++++++++++++++++-- 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/src/ext/conf/BrowserDetect.js b/src/ext/conf/BrowserDetect.js index 1d61eae..e6f4ca3 100644 --- a/src/ext/conf/BrowserDetect.js +++ b/src/ext/conf/BrowserDetect.js @@ -4,6 +4,7 @@ const BrowserDetect = { firefox: process.env.BROWSER === 'firefox', chrome: process.env.BROWSER === 'chrome', edge: process.env.BROWSER === 'edge', + processEnvBrowser: process.env.BROWSER, } if (Debug.debug) { diff --git a/src/options/about.vue b/src/options/about.vue index 5ba7955..5764300 100644 --- a/src/options/about.vue +++ b/src/options/about.vue @@ -5,8 +5,8 @@

Having an issue? Report undocumented features bugs using one of the following options:

@@ -32,11 +32,34 @@ \ No newline at end of file diff --git a/src/popup/panels/AboutPanel.vue b/src/popup/panels/AboutPanel.vue index fddf67b..b60b6b5 100644 --- a/src/popup/panels/AboutPanel.vue +++ b/src/popup/panels/AboutPanel.vue @@ -7,8 +7,8 @@ Having an issue?
Report undocumented features bugs using one of the following options:
If reporting perfomrance/RAM usage issue, please include your CPU model and RAM. @@ -19,11 +19,34 @@ From 1157a8a8e2001a91560b04377bcb49c7ff2c311a Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sat, 2 Nov 2019 22:42:36 +0100 Subject: [PATCH 02/10] Update readme --- CHANGELOG.md | 2 ++ src/popup/panels/WhatsNewPanel.vue | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 346b51d..d9a0880 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ QoL improvements for me: * Changing aspect ratio now resets zooming and panning. * Fixed bug where keyboard shortcuts would work while typing in certain text fields * Fixed minor bug with autodetection +* **[4.4.0.1]** fixed mailto and reddit compose links. When reporting issues via e-mail or reddit, extension version, browser +and OS are automatically included in email/reddit template. ### v4.3.1 diff --git a/src/popup/panels/WhatsNewPanel.vue b/src/popup/panels/WhatsNewPanel.vue index 23988e0..6499374 100644 --- a/src/popup/panels/WhatsNewPanel.vue +++ b/src/popup/panels/WhatsNewPanel.vue @@ -13,6 +13,8 @@
  • Changing aspect ratio now resets zooming and panning.
  • Fixed bug where keyboard shortcuts would work while typing in certain text fields
  • Fixed a minor bug with autodetection
  • +
  • [4.4.0.1] — fixed mailto: and reddit compose links. When reporting bugs, email/reddit template now + automatically gathers browser, extension version and OS.
  • From 5f4abcec1f68f3be87f191bf15bcb69e92ff209b Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sat, 2 Nov 2019 22:43:11 +0100 Subject: [PATCH 03/10] version bump --- src/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/manifest.json b/src/manifest.json index 76e73a2..915e37a 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.4.0", + "version": "4.4.0.1", "applications": { "gecko": { "id": "{cf02b1a7-a01a-4e37-a609-516a283f1ed3}" From 08460a923d6b9d6dbfeee0792b13a4cf9fb5c4cd Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Mon, 4 Nov 2019 22:14:41 +0100 Subject: [PATCH 04/10] Fix logger --- src/ext/lib/Logger.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/ext/lib/Logger.js b/src/ext/lib/Logger.js index 104e4a0..ed009d9 100644 --- a/src/ext/lib/Logger.js +++ b/src/ext/lib/Logger.js @@ -120,27 +120,29 @@ class Logger { if (!this.conf.fileOptions.enabled || this.temp_disable) { return false; } - if (component.length ) { - for (const c in component) { - if (this.conf.fileOptions[component]) { - return this.conf.fileOptions[component]; + if (Array.isArray(component) && component.length ) { + for (const c of component) { + if (this.conf.fileOptions[c]) { + return this.conf.fileOptions[c]; } } - } - return this.conf.fileOptions[component]; + } else { + return this.conf.fileOptions[component]; + } } canLogConsole(component) { if (!this.conf.consoleOptions.enabled || this.temp_disable) { return false; } if (Array.isArray(component) && component.length) { - for (const c in component) { - if (this.conf.consoleOptions[component]) { - return this.conf.consoleOptions[component]; + for (const c of component) { + if (this.conf.consoleOptions[c]) { + return this.conf.consoleOptions[c]; } } - } - return this.conf.consoleOptions[component]; + } else { + return this.conf.consoleOptions[component]; + } } // level is unused as of now, but this may change in the future From 4fc68db7f867dbc1e45f692fa20439231cc93cf5 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Mon, 4 Nov 2019 23:50:54 +0100 Subject: [PATCH 05/10] Disable logging --- src/ext/uw.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ext/uw.js b/src/ext/uw.js index e7bb6f8..32de20a 100644 --- a/src/ext/uw.js +++ b/src/ext/uw.js @@ -44,7 +44,7 @@ class UW { if (!this.logger) { const loggingOptions = { logToFile: false, - logToConsole: true, + logToConsole: false, fileOptions: { // really the same stuff as consoleOptions }, From 414bf7b36f00c3c023807bc85bc514e2476addbb Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Mon, 4 Nov 2019 23:52:37 +0100 Subject: [PATCH 06/10] Update logger output --- src/ext/lib/video-transform/Resizer.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/ext/lib/video-transform/Resizer.js b/src/ext/lib/video-transform/Resizer.js index 7cecc69..e26b89c 100644 --- a/src/ext/lib/video-transform/Resizer.js +++ b/src/ext/lib/video-transform/Resizer.js @@ -437,15 +437,18 @@ class Resizer { translate.x -= wdiffAfterZoom * 0.5; } } - - this.logger.log('info', 'debug', "[Resizer::_res_computeOffsets] calculated offsets:\n\n", - '---- data in ----\n', - 'player dimensions:', {w: this.conf.player.dimensions.width, h: this.conf.player.dimensions.height}, - 'video dimensions: ', {w: this.conf.video.offsetWidth, h: this.conf.video.offsetHeight}, - 'stretch factors: ', stretchFactors, - 'pan & zoom: ', this.pan, this.zoom, + + this.logger.log('info', ['debug', 'resizer'], "[Resizer::_res_computeOffsets] calculated offsets:\n\n", + '---- data in ----', + '\nplayer dimensions: ', {w: this.conf.player.dimensions.width, h: this.conf.player.dimensions.height}, + '\nvideo dimensions: ', {w: this.conf.video.offsetWidth, h: this.conf.video.offsetHeight}, + '\nstretch factors: ', stretchFactors, + '\npan & zoom: ', this.pan, this.zoom, + '\nwdiff, hdiff: ', wdiff, 'x', hdiff, + '\nwdiff, hdiffAfterZoom:', wdiffAfterZoom, 'x', hdiffAfterZoom, '\n\n---- data out ----\n', 'translate:', translate); + console.trace(); return translate; } @@ -513,7 +516,7 @@ class Resizer { return; } - this.logger.log('info', 'resizer', "[Resizer::applyCss] will apply css.", {stretchFactors, translate}); + this.logger.log('info', ['debug', 'resizer'], "[Resizer::applyCss] will apply css.", {stretchFactors, translate}); // save stuff for quick tests (before we turn numbers into css values): this.currentVideoSettings = { From 5fc867b4a39520a4fb52ca9b6844ff7e57a5e3eb Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Mon, 4 Nov 2019 23:53:08 +0100 Subject: [PATCH 07/10] Fix for vk --- src/ext/lib/video-data/PlayerData.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/ext/lib/video-data/PlayerData.js b/src/ext/lib/video-data/PlayerData.js index b9f87bb..ec6ae3f 100644 --- a/src/ext/lib/video-data/PlayerData.js +++ b/src/ext/lib/video-data/PlayerData.js @@ -283,17 +283,20 @@ class PlayerData { score = 100; - - if (element.id.indexOf('player') !== -1) { // prefer elements with 'player' in id - score += 75; - } + // This entire section is disabled because of some bullshit on vk and some shady CIS streaming sites. + // Possibly removal of this criteria is not necessary, because there was also a bug with force player + // + + // if (element.id.indexOf('player') !== -1) { // prefer elements with 'player' in id + // score += 75; + // } // this has only been observed on steam - if (element.id.indexOf('movie') !== -1) { - score += 75; - } - if (element.classList.toString().indexOf('player') !== -1) { // prefer elements with 'player' in classlist, but a bit less than id - score += 50; - } + // if (element.id.indexOf('movie') !== -1) { + // score += 75; + // } + // if (element.classList.toString().indexOf('player') !== -1) { // prefer elements with 'player' in classlist, but a bit less than id + // score += 50; + // } score -= scorePenalty++; // prefer elements closer to