From a461d8fa71bb080058565a5306f9efb213d7e72b Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sun, 20 Oct 2019 14:03:09 +0200 Subject: [PATCH 1/5] test videos update --- test/TEST_VIDEOS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/TEST_VIDEOS.md b/test/TEST_VIDEOS.md index 38c8ed5..50c5ca3 100644 --- a/test/TEST_VIDEOS.md +++ b/test/TEST_VIDEOS.md @@ -20,8 +20,8 @@ https://streamable.com/vrb4w https://clips.twitch.tv/DirtyHotLampOpieOP -Also full stream — minor aspect ratio corrections are being triggered after the intro: https://www.twitch.tv/videos/330639009 -Gets especially bad during WoW segment: https://www.twitch.tv/videos/330639009?t=1h49m20s +Also full stream: https://www.twitch.tv/videos/330639009 +WoW segment with switch from 16:9 -> 21:9: https://www.twitch.tv/videos/330639009?t=1h49m20s ## Youtube From cec427d9abb4921b2296b67eab1b3f07596c7c69 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sun, 20 Oct 2019 14:09:19 +0200 Subject: [PATCH 2/5] fix for twitch --- src/ext/conf/ExtConfPatches.js | 15 +++++++++++++++ src/ext/conf/ExtensionConf.js | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/ext/conf/ExtConfPatches.js b/src/ext/conf/ExtConfPatches.js index 754c814..edd73d1 100644 --- a/src/ext/conf/ExtConfPatches.js +++ b/src/ext/conf/ExtConfPatches.js @@ -102,6 +102,21 @@ const ExtensionConfPatch = [ css: 'video {\n width: 100% !important;\n height: 100% !important;\n}', }, } + }, { + forVersion: '4.3.0.1', + sites: { + 'twitch.tv': { + DOM: { + player: { + manual: false, + querySelectors: "", + additionalCss: "", + useRelativeAncestor: false, + playerNodeCss: "" + } + } + } + } } ]; diff --git a/src/ext/conf/ExtensionConf.js b/src/ext/conf/ExtensionConf.js index 0a14d9e..fe99216 100644 --- a/src/ext/conf/ExtensionConf.js +++ b/src/ext/conf/ExtensionConf.js @@ -940,8 +940,8 @@ whatsNewChecked: true, keyboardShortcutsEnabled: ExtensionMode.Default, DOM: { player: { - manual: true, - querySelectors: ".video-player__container.player", + manual: false, + querySelectors: "", additionalCss: "", useRelativeAncestor: false, playerNodeCss: "" From 7a9c341bf821cd907462555a2645938af19c4cf2 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sun, 20 Oct 2019 14:13:58 +0200 Subject: [PATCH 3/5] Version update stuff --- CHANGELOG.md | 1 + src/ext/conf/ExtConfPatches.js | 2 +- src/manifest.json | 2 +- src/popup/panels/WhatsNewPanel.vue | 3 ++- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be98915..117e1c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ QoL improvements for me: * Minor rework of settings page (actions & shortcuts section) * Fixed bug that prevented settings page from opening +* **[4.3.1.1]** quick patch for twitch.tv ### v4.3.0 diff --git a/src/ext/conf/ExtConfPatches.js b/src/ext/conf/ExtConfPatches.js index edd73d1..ed460dd 100644 --- a/src/ext/conf/ExtConfPatches.js +++ b/src/ext/conf/ExtConfPatches.js @@ -103,7 +103,7 @@ const ExtensionConfPatch = [ }, } }, { - forVersion: '4.3.0.1', + forVersion: '4.3.1.1', sites: { 'twitch.tv': { DOM: { diff --git a/src/manifest.json b/src/manifest.json index f2f0224..9142234 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.3.1", + "version": "4.3.1.1", "applications": { "gecko": { "id": "{cf02b1a7-a01a-4e37-a609-516a283f1ed3}" diff --git a/src/popup/panels/WhatsNewPanel.vue b/src/popup/panels/WhatsNewPanel.vue index 410668d..1e8df1a 100644 --- a/src/popup/panels/WhatsNewPanel.vue +++ b/src/popup/panels/WhatsNewPanel.vue @@ -2,8 +2,9 @@

What's new

Full changelog for older versions is available here.

-

4.3.1

+

4.3.1.1

    +
  • [4.3.3.1] Patched twitch.tv
  • Minor rework of settings page (actions & shortcuts section)
  • Fixed bug that prevented settings page from opening
From 85fa314bb40e925bb663ae0e53702368c862c120 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sun, 20 Oct 2019 21:11:09 +0200 Subject: [PATCH 4/5] change some variable names for readability --- src/ext/lib/ObjectCopy.js | 40 ++++++++++++++++++++------------------- src/ext/lib/Settings.js | 1 - 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/ext/lib/ObjectCopy.js b/src/ext/lib/ObjectCopy.js index 705613b..2bceccf 100644 --- a/src/ext/lib/ObjectCopy.js +++ b/src/ext/lib/ObjectCopy.js @@ -1,12 +1,12 @@ import Debug from '../conf/Debug'; class ObjectCopy { - static addNew(existing, target){ + static addNew(current, newValues){ // clone target - var out = JSON.parse(JSON.stringify(target)); + var out = JSON.parse(JSON.stringify(newValues)); - if(! existing) { + if(! current) { if(Debug.debug) { console.log("[ObjectCopy::addNew] There's no existing value. Returning target value."); } @@ -16,10 +16,10 @@ class ObjectCopy { for(var k in out) { // if current key exist, replace it with existing value. Take no action otherwise. - if(existing[k]) { + if(current[k]) { // Types and constructors of objects must match. If they don't, we always use the new value. - if(typeof out[k] === typeof existing[k] && out[k].constructor === existing[k].constructor) { + if(typeof out[k] === typeof current[k] && out[k].constructor === current[k].constructor) { // objects are special, we need to check them recursively. if(out[k] && typeof out[k] === 'object' && out[k].constructor === Object ) { @@ -27,9 +27,9 @@ class ObjectCopy { console.log("[ObjectCopy::addNew] current key contains an object. Recursing!") } - out[k] = this.addNew(existing[k], out[k]); + out[k] = this.addNew(current[k], out[k]); } else { - out[k] = existing[k]; + out[k] = current[k]; } } } @@ -37,39 +37,41 @@ class ObjectCopy { // add the values that would otherwise be deleted back to our object. (We need that so user-defined // sites don't get forgotten) - for(var k in existing) { + for(var k in current) { if (! out[k]) { - out[k] = existing[k]; + out[k] = current[k]; } } return out; } - static overwrite(existing, target){ - for(var k in target) { + static overwrite(current, newValues){ + for(var k in newValues) { // if current key exist, replace it with existing value. Take no action otherwise. - if (existing[k]) { - + if (current[k] !== undefined) { // Types and constructors of objects must match. If they don't, we always use the new value. - if (typeof target[k] === typeof existing[k] && target[k].constructor === existing[k].constructor) { + if (typeof newValues[k] === typeof current[k] && newValues[k].constructor === current[k].constructor) { // objects are special, we need to check them recursively. - if(existing[k] && typeof existing[k] === 'object' && existing[k].constructor === Object ) { + if(current[k] && typeof current[k] === 'object' && current[k].constructor === Object ) { if(Debug.debug && Debug.settings) { console.log("[ObjectCopy::addNew] current key contains an object. Recursing!") } - existing[k] = this.overwrite(existing[k], target[k]); + current[k] = this.overwrite(current[k], newValues[k]); } else { - existing[k] = target[k]; + current[k] = newValues[k]; } } else { - existing[k] = target[k]; + current[k] = newValues[k]; } } + else if (newValues[k] !== undefined) { + current[k] = newValues[k]; + } } - return existing; + return current; } static pruneUnused(existing, target, ignoreKeys) { diff --git a/src/ext/lib/Settings.js b/src/ext/lib/Settings.js index ca68d9e..0caed9e 100644 --- a/src/ext/lib/Settings.js +++ b/src/ext/lib/Settings.js @@ -158,7 +158,6 @@ class Settings { while (index < patches.length) { delete patches[index].forVersion; ObjectCopy.overwrite(this.active, patches[index]); - index++; } } From fdc4fc8dc9fac9fdfaac904149b8016fdc4a0442 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sun, 20 Oct 2019 21:11:17 +0200 Subject: [PATCH 5/5] fix the fix --- src/ext/conf/ExtConfPatches.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ext/conf/ExtConfPatches.js b/src/ext/conf/ExtConfPatches.js index ed460dd..6400829 100644 --- a/src/ext/conf/ExtConfPatches.js +++ b/src/ext/conf/ExtConfPatches.js @@ -105,7 +105,7 @@ const ExtensionConfPatch = [ }, { forVersion: '4.3.1.1', sites: { - 'twitch.tv': { + 'www.twitch.tv': { DOM: { player: { manual: false,