Merge branch 'master' into stable

This commit is contained in:
Tamius Han 2019-10-20 21:12:43 +02:00
commit c28651d9f7
8 changed files with 44 additions and 26 deletions

View File

@ -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

View File

@ -102,6 +102,21 @@ const ExtensionConfPatch = [
css: 'video {\n width: 100% !important;\n height: 100% !important;\n}',
},
}
}, {
forVersion: '4.3.1.1',
sites: {
'www.twitch.tv': {
DOM: {
player: {
manual: false,
querySelectors: "",
additionalCss: "",
useRelativeAncestor: false,
playerNodeCss: ""
}
}
}
}
}
];

View File

@ -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: ""

View File

@ -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) {

View File

@ -158,7 +158,6 @@ class Settings {
while (index < patches.length) {
delete patches[index].forVersion;
ObjectCopy.overwrite(this.active, patches[index]);
index++;
}
}

View File

@ -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}"

View File

@ -2,8 +2,9 @@
<div>
<h2>What's new</h2>
<p>Full changelog for older versions <a href="https://github.com/xternal7/ultrawidify/blob/master/CHANGELOG.md">is available here</a>.</p>
<p class="label">4.3.1</p>
<p class="label">4.3.1.1</p>
<ul>
<li><b>[4.3.3.1]</b> Patched twitch.tv</li>
<li>Minor rework of settings page (actions & shortcuts section)</li>
<li>Fixed bug that prevented settings page from opening</li>
</ul>

View File

@ -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