Skip to content

Commit 31594ca

Browse files
committed
Fix for new YouTube styles. I win again.
1 parent ec05312 commit 31594ca

14 files changed

+127
-59
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,5 @@ This is a **general non-exhaustive** list of SeriStyle's features. Preview & com
8383
## Credits & Gratitude
8484
### Services
8585
All of the following services are free-of-charge, which is already worth being credited.
86-
- [NoEmbed](https://noembed.com) - Required by SeriStyle to convert playlists into videos.
8786
- [Wayback Machine/Web Archive](https://web.archive.org) - For archiving old versions of several YouTube pages to match against.
87+
<!-- - [NoEmbed](https://noembed.com) - Required by SeriStyle to convert playlists into videos. -->

bgworker.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
if (env.runtime.getBrowserInfo) {
66
let BrowserInfo = await env.runtime.getBrowserInfo();
7-
IsFirefox = BrowserInfo.name == "Firefox" || BrowserInfo.vendor == "Mozilla";
7+
IsFirefox = BrowserInfo.name == "Firefox" || BrowserInfo.vendor == "Mozilla"; // yeah dawg, if you're using smth that doesn't follow this rule, GFY LMFAOOOOOOO FORK USER (user issue frfr)
88
}
99
env.runtime.onMessage.addListener((Message, Sender, Respond) => {
1010
switch (Message.Operation) {
@@ -21,13 +21,8 @@
2121
return;
2222
}
2323
});
24-
env.webNavigation.onHistoryStateUpdated.addListener(function(Data) {
25-
if (Data == null || !Data.url.includes("youtube")) return;
26-
try {
27-
console.log(Data);
28-
env.tabs.sendMessage(Data.tabId, { Operation: "SeriStyle_HistoryState", Args: [Data.url] });
29-
} catch {
30-
console.log("Receiving end error.", JSON.stringify(Data, null, "\t"));
31-
}
24+
env.webNavigation.onHistoryStateUpdated.addListener(function (Data) {
25+
if (Data == null || !new URL(Data.url).hostname.includes("youtube")) return;
26+
env.tabs.sendMessage(Data.tabId, { Operation: "SeriStyle_HistoryState", Args: [Data.url] }).catch(() => console.log("Receiving end error.", JSON.stringify(Data, null, "\t")));
3227
});
3328
})();

html/config.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
body {
2-
/* I'd like to have a photo here but everything is licensed af :skull: */
32
background: #000;
43
font-family: Roboto, Arial, Helvetica, sans-serif;
5-
width: 100%;
64
align-items: center;
75
}
86

html/popup.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<div id="central-logo">
1616
<img src="../icons/default64.png">
1717
<span id="central-name">SeriStyle</span>
18-
<span class="central-sub">v1.12.1</span>
18+
<span class="central-sub">v1.12.2</span>
1919
<span class="central-sub" id="storage-status"></span>
2020
</div>
2121
<div id="interactions">

html/popup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ document.addEventListener('DOMContentLoaded', function () {
1111
});
1212
document.getElementById("low-i-debug").onclick = async () => {
1313
var DebugInfo = [
14-
"- SeriStyle v1.12.1",
14+
"- SeriStyle v1.12.2",
1515
"- " + navigator.userAgent,
1616
"- " + StorageMode
1717
];

manifest.firefox.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": 3,
33
"name": "SeriStyle",
44
"author": "Nekoseri",
5-
"version": "1.12.1",
5+
"version": "1.12.2",
66
"description": "Bring the early-2021 UI back to YouTube!",
77
"icons": {
88
"16": "icons/default16.png",

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": 3,
33
"name": "SeriStyle",
44
"author": "Nekoseri",
5-
"version": "1.12.1",
5+
"version": "1.12.2",
66
"description": "Bring the early-2021 UI back to YouTube!",
77
"icons": {
88
"16": "icons/default16.png",

scripts/defaults.js

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
this.SeriStyleMetaVersion = 4;
1+
this.SeriStyleMetaVersion = 5;
22
this.SeriStyleMetaNotice = [
33
"introduced new settings:",
4-
"Videopage changes -> Fix content padding",
5-
"Videopage changes -> Force min. content padding",
4+
"Videopage changes -> Hide donation shelves",
5+
"Advanced -> Improve action bar mutation success rate (BETA)",
6+
"Advanced -> Disable all hotfixes",
67
].join("\n");
78

89
this.SeriStyleLocales = {
@@ -23,7 +24,7 @@ this.SeriStyleLocales = {
2324
Advanced: "Advanced settings"
2425
},
2526
Messages: {
26-
UpdateSettings: "SeriStyle was updated to version 1.12.1, which " + this.SeriStyleMetaNotice + "\n\nDo you want to visit the settings page(opens in a new tab)?"
27+
UpdateSettings: "SeriStyle was updated to version 1.12.2, which " + this.SeriStyleMetaNotice + "\n\nDo you want to visit the settings page(opens in a new tab)?"
2728
}
2829
}
2930
};
@@ -152,6 +153,13 @@ this.SeriStyleSettings = {
152153
},
153154
Value: false
154155
},
156+
HideDonationShelves: {
157+
Kind: 0,
158+
Name: {
159+
"en-US": "Hide donation shelves"
160+
},
161+
Value: false
162+
},
155163
HideRecFilters: {
156164
Kind: 0,
157165
Name: {
@@ -365,6 +373,20 @@ this.SeriStyleSettings = {
365373
"en-US": "$ms"
366374
}
367375
},
376+
ActionBarPlus: {
377+
Kind: 0,
378+
Name: {
379+
"en-US": "Improve action bar mutation success rate (BETA)"
380+
},
381+
Value: false
382+
},
383+
DisableHotfixes: {
384+
Kind: 0,
385+
Name: {
386+
"en-US": "Disable all hotfixes"
387+
},
388+
Value: false
389+
},
368390
DisableCSS: {
369391
Kind: 0,
370392
Name: {
@@ -437,4 +459,4 @@ this.SvgMic = '<svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focu
437459
this.SvgMenu = '<svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" class="style-scope yt-icon" style="pointer-events: none; display: block; width: 100%; height: 100%;"><g class="style-scope yt-icon"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" class="style-scope yt-icon"></path></g></svg>';
438460

439461
this.PathVerified = "M12,2C6.48,2,2,6.48,2,12s4.48,10,10,10s10-4.48,10-10 S17.52,2,12,2z M9.92,17.93l-4.95-4.95l2.05-2.05l2.9,2.9l7.35-7.35l2.05,2.05L9.92,17.93z";
440-
this.PathProducer = "M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z";
462+
this.PathProducer = "M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z";

scripts/page-observer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var GeneralTransformerBurned = false;
2222
var GT_Burn1 = false;
2323
var GT_Burn2 = false;
2424

25-
var PageObserver = new MutationObserver(async Mutations => { // TODO: I have no idea why this is async. I'm keeping it because I'm scared.
25+
var PageObserver = new MutationObserver(async Mutations => {
2626
var Inserted = [];
2727
Mutations.forEach(Mutation => {
2828
for (let i = 0; i < Mutation.addedNodes.length; i++) {

scripts/transformer-css.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ document.head.appendChild(DomUtils.BuildElement("style", {
100100
"}" +
101101

102102
/* Playlists */
103+
// Remove roundings
104+
"ytd-playlist-video-renderer{border-radius:0px;}" +
105+
// Old title font
106+
"#text.yt-sans-28{font-family:Roboto,Arial,sans-serif;font-size:24px;font-weight:400;line-height:34px;text-decoration-color:#FFF;text-decoration-line:none;text-decoration-style:solid;text-decoration-thickness:auto;text-size-adjust:100%;word-break:break-word;}" + // Alternative selector: .thumbnail-and-metadata-wrapper>div>yt-dynamic-sizing-formatted-string>div>yt-formatted-string
107+
// True Old
103108
(SeriStyleSettings.Playlist.TrueOld.Value ? // TODO: Move duplicates outside of this scope
104109
// Restore position & dimensions, fix colors
105110
"ytd-browse.ytd-page-manager{padding-top:0px;}" +
@@ -114,14 +119,10 @@ document.head.appendChild(DomUtils.BuildElement("style", {
114119
"yt-formatted-string.byline-item>span{display:inline-block;}" +
115120
"div.metadata-stats.ytd-playlist-byline-renderer{max-height:unset;overflow:visible;display:block;}" +
116121
"yt-formatted-string.byline-item:not(:nth-child(6))::after{content:'•';margin-left:4px;margin-right:2px;}" +
117-
// Old title font(might affect certain other entries)
118-
"#text.yt-sans-28{font-family:Roboto,Arial,sans-serif;font-size:24px;font-weight:400;line-height:34px;text-decoration-color:#FFF;text-decoration-line:none;text-decoration-style:solid;text-decoration-thickness:auto;text-size-adjust:100%;word-break:break-word;}" + // Alternative selector: .thumbnail-and-metadata-wrapper>div>yt-dynamic-sizing-formatted-string>div>yt-formatted-string
119122
// Remove cover thumbnail rounding
120123
(SeriStyleSettings.General.ThumbnailRoundings.Value ? ".image-wrapper{border-radius:0px;}" : "") +
121124
// Old video list padding
122125
"ytd-two-column-browse-results-renderer[page-subtype='playlist'].ytd-browse,ytd-browse[page-subtype='playlist']>#alerts{padding-left:360px;}" +
123-
// Remove roundings
124-
"ytd-playlist-video-renderer{border-radius:0px;}" +
125126
//
126127
""
127128
:
@@ -130,10 +131,6 @@ document.head.appendChild(DomUtils.BuildElement("style", {
130131
"yt-formatted-string.byline-item>span{display:inline-block;}" +
131132
"div.metadata-stats.ytd-playlist-byline-renderer{max-height:unset;overflow:visible;display:block;}" +
132133
"yt-formatted-string.byline-item:not(:nth-child(6))::after{content:'•';margin-left:4px;margin-right:2px;}" +
133-
// Old title font(might affect certain other entries)
134-
"#text.yt-sans-28{font-family:Roboto,Arial,sans-serif;font-size:24px;font-weight:400;line-height:34px;text-decoration-color:#FFF;text-decoration-line:none;text-decoration-style:solid;text-decoration-thickness:auto;text-size-adjust:100%;word-break:break-word;}" + // Alternative selector: .thumbnail-and-metadata-wrapper>div>yt-dynamic-sizing-formatted-string>div>yt-formatted-string
135-
// Remove roundings
136-
"ytd-playlist-video-renderer{border-radius:0px;}" +
137134
//
138135
""
139136
) +

0 commit comments

Comments
 (0)