Skip to content

Commit a053438

Browse files
committed
Those styles are becoming so aids.
1 parent db67fab commit a053438

File tree

9 files changed

+65
-33
lines changed

9 files changed

+65
-33
lines changed

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.11.3</span>
18+
<span class="central-sub">v1.12.0</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.11.3",
14+
"- SeriStyle v1.12.0",
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.11.3",
5+
"version": "1.12.0",
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.11.3",
5+
"version": "1.12.0",
66
"description": "Bring the early-2021 UI back to YouTube!",
77
"icons": {
88
"16": "icons/default16.png",

scripts/defaults.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
this.SeriStyleMetaVersion = 2;
1+
this.SeriStyleMetaVersion = 3;
22

33
this.SeriStyleLocales = {
44
"en-US": {
@@ -18,7 +18,7 @@ this.SeriStyleLocales = {
1818
Advanced: "Advanced settings"
1919
},
2020
Messages: {
21-
UpdateSettings: "SeriStyle was updated to version 1.11.3, which introduced new settings!\n\nDo you want to visit the settings page(opens in a new tab)?"
21+
UpdateSettings: "SeriStyle was updated to version 1.12.0, which introduced new settings!\n\nDo you want to visit the settings page(opens in a new tab)?"
2222
}
2323
}
2424
};
@@ -339,17 +339,17 @@ this.SeriStyleSettings = {
339339
"en-US": "$ms"
340340
}
341341
},
342-
LegacyPanels: {
342+
DisableCSS: {
343343
Kind: 0,
344344
Name: {
345-
"en-US": "Legacy(v1.2.0) panel style"
345+
"en-US": "Disable all CSS transformers"
346346
},
347347
Value: false
348348
},
349-
LegacySubButton: {
349+
LegacyPanels: {
350350
Kind: 0,
351351
Name: {
352-
"en-US": "Legacy(v1.4.0) subscribe button"
352+
"en-US": "Legacy(v1.2.0) panel style"
353353
},
354354
Value: false
355355
},
@@ -366,6 +366,7 @@ this.SeriStyleSettings = {
366366
this.DomUtils = {
367367
"GetValue": (Element) => Element.value || Element.innerText,
368368
"BuildElement": function (Tag, Characteristics, Inner, Callback) {
369+
if (Tag == "style" && SeriStyleSettings.Advanced.DisableCSS.Value) return document.createElement(Tag);
369370
var elem = document.createElement(Tag);
370371
for (let _ in (Characteristics || {})) {
371372
elem[_] = Characteristics[_];

scripts/page-observer.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var Environment = this.browser || this.chrome;
1414
Environment.runtime.onMessage.addListener((Message) => {
1515
if (Message.Operation != "SeriStyle_HistoryState") return;
1616
var URL = Message.Args[0];
17-
window.dispatchEvent(new CustomEvent("historychange", {detail: Message.Args[0]}));
17+
window.dispatchEvent(new CustomEvent("historychange", { detail: Message.Args[0] }));
1818
});
1919

2020
var GeneralTransformerBurned = false;
@@ -90,4 +90,7 @@ PageObserver.observe(document.querySelector("ytd-app"), {
9090
});
9191

9292
GT_Burn1 = !!document.querySelector("#search-icon-legacy>yt-icon.ytd-searchbox");
93-
GT_Burn2 = !!document.querySelector("#voice-search-button yt-icon");
93+
GT_Burn2 = !!document.querySelector("#voice-search-button yt-icon");
94+
95+
if (SeriStyleSettings.Advanced.DisableCSS.Value)
96+
console.log("[SeriStyle|EarlyBird] Disabled all CSS transformers for this page.");

scripts/transformer-css.js

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// jshint -W014, -W086
22

3-
var SelSubPassiveBtn = "#subscribe-button yt-button-shape>button";
4-
var SelSubContainer = "yt-smartimation.ytd-subscribe-button-renderer"; // Alt: #subscribe-button yt-smartimation
3+
var SelSubPassiveBtn = "#subscribe-button-shape>button"; // Old: #subscribe-button yt-button-shape>button
4+
var SelSubContainer = "yt-smartimation.ytd-subscribe-button-renderer>.smartimation__content>__slot-el"; // [OLD] Alt: #subscribe-button yt-smartimation
55
var SelMeta = "#meta.ytd-c4-tabbed-header-renderer";
66
var SelMetaSpan = SelMeta + ">span.meta-item";
77

@@ -10,6 +10,8 @@ document.head.appendChild(DomUtils.BuildElement("style", {
1010
"innerText":
1111
(
1212
/* General */
13+
// Remove "You"
14+
"ytd-guide-collapsible-section-entry-renderer>#header{display:none;}" +
1315
// Old search box styles
1416
"#container.ytd-searchbox{" + (SeriStyleSettings.General.NormalizeSearchBar.Value ? "margin-left:0px;" : "") + "position:relative;align-items:center;border:1px solid var(--ytd-searchbox-legacy-border-color);border-right:none;border-radius:2px 0 0 2px;box-shadow:inset 0 1px 2px var(--ytd-searchbox-legacy-border-shadow-color);padding:2px 6px;flex:1;flex-basis:1e-9px;display:flex;flex-direction:row;}" +
1517
// Prepare voice search button
@@ -31,24 +33,19 @@ document.head.appendChild(DomUtils.BuildElement("style", {
3133
"#sponsor-button yt-button-shape>button{" + (SeriStyleSettings.VideoPage.HideJoinButton.Value ? "display:none;" : "text-transform:uppercase;background:none;border:1px solid #3EA6FF;color:#3EA6FF;border-radius:3px;") + "}" +
3234
"#analytics-button yt-button-shape>button{text-transform:uppercase;background:#065FD4;color:#FFF;border-radius:3px;}"
3335
: "") +
34-
// Old subscribe button color & form
36+
// Fix the Unsubscribe button
37+
"ytd-subscribe-button-renderer{transition:none;width:unset;}" +
3538
SelSubPassiveBtn + "{border-radius:3px;text-transform:uppercase;}" +
3639
SelSubPassiveBtn + ".yt-spec-button-shape-next--filled{background:#C00;color:#FFF;}" + // "SUBSCRIBE" button, red color
37-
(SeriStyleSettings.Advanced.LegacySubButton.Value
38-
? SelSubPassiveBtn + ".yt-spec-button-shape-next--tonal{background:#2C2C2C;color:#A8A8A8;}"
39-
: "#subscribe-button>ytd-subscribe-button-renderer>yt-smartimation>yt-button-shape>button{background:#2C2C2C;color:#A8A8A8;}"
40-
) +
41-
// Fix sub button
42-
(!SeriStyleSettings.Advanced.LegacySubButton.Value ?
43-
"#subscribe-button yt-button-shape[hidden]{display:block;}" +
44-
"#notification-preference-button div.cbox{display:none;}" + // widest: "#notification-preference-button > ytd-subscription-notification-toggle-button-renderer-next > yt-button-shape > button > div.cbox.yt-spec-button-shape-next--button-text-content"
45-
"#notification-preference-button div.yt-spec-button-shape-next__secondary-icon{display:none;}" + // widest: #notification-preference-button > ytd-subscription-notification-toggle-button-renderer-next > yt-button-shape > button > div.yt-spec-button-shape-next__secondary-icon
46-
"#notification-preference-button div.yt-spec-button-shape-next__icon{margin-right:0px;}" + // widest: #notification-preference-button > ytd-subscription-notification-toggle-button-renderer-next > yt-button-shape > button > div.yt-spec-button-shape-next__icon
47-
"#notification-preference-button button{background:none;padding-right:0px;}" + // widest: #notification-preference-button > ytd-subscription-notification-toggle-button-renderer-next > yt-button-shape > button
48-
"#notification-preference-button div.yt-spec-button-shape-next__button-text-content{display:none;}"
49-
: "") +
40+
SelSubPassiveBtn + "{background:#2C2C2C;color:#A8A8A8;}" +
41+
"#subscribe-button yt-button-shape[invisible]{display:block;position:unset;pointer-events:unset;visibility:unset;}" +
42+
"#notification-preference-button div.cbox{display:none;}" + // widest: "#notification-preference-button > ytd-subscription-notification-toggle-button-renderer-next > yt-button-shape > button > div.cbox.yt-spec-button-shape-next--button-text-content"
43+
"#notification-preference-button div.yt-spec-button-shape-next__secondary-icon{display:none;}" + // widest: #notification-preference-button > ytd-subscription-notification-toggle-button-renderer-next > yt-button-shape > button > div.yt-spec-button-shape-next__secondary-icon
44+
"#notification-preference-button div.yt-spec-button-shape-next__icon{margin-right:0px;}" + // widest: #notification-preference-button > ytd-subscription-notification-toggle-button-renderer-next > yt-button-shape > button > div.yt-spec-button-shape-next__icon
45+
"#notification-preference-button button{background:none;padding-right:0px;}" + // widest: #notification-preference-button > ytd-subscription-notification-toggle-button-renderer-next > yt-button-shape > button
46+
"#notification-preference-button div.yt-spec-button-shape-next__button-text-content{display:none;}" +
5047
// Fix notification bell
51-
(!SeriStyleSettings.Advanced.LegacyImation.Value ?
48+
(!SeriStyleSettings.Advanced.LegacyImation.Value ? // TODO: Pending removal
5249
SelSubContainer + "{display:flex;flex-direction:row;}"
5350
: "") +
5451
// Hide channel handles
@@ -103,7 +100,7 @@ document.head.appendChild(DomUtils.BuildElement("style", {
103100
"}" +
104101

105102
/* Playlists */
106-
(SeriStyleSettings.Playlist.TrueOld.Value ?
103+
(SeriStyleSettings.Playlist.TrueOld.Value ? // TODO: Move duplicates outside of this scope
107104
// Restore position & dimensions, fix colors
108105
"ytd-browse.ytd-page-manager{padding-top:0px;}" +
109106
"ytd-playlist-header-renderer{background:rgba(255,255,255,0.05);margin-left:0px;height:calc(100vh - var(--ytd-toolbar-height));}" + // In the past: var(--yt-spec-general-background-a)
@@ -142,14 +139,35 @@ document.head.appendChild(DomUtils.BuildElement("style", {
142139
) +
143140

144141
/* Channel Page */
145-
(SeriStyleSettings.ChannelPage.TrueOld.Value ?
142+
(SeriStyleSettings.ChannelPage.TrueOld.Value ? // TODO: Relocate this... maybe?
143+
// Metadata: Only show subscriber count
146144
SelMetaSpan + "{margin:0;}" +
147145
SelMetaSpan + ">#channel-handle{display:none;}" +
148146
SelMetaSpan + ">#videos-count{display:none;}" +
147+
SelMeta + " span.delimiter{display:none;}" +
149148
SelMeta + ">#channel-tagline{display:none;}" +
149+
SelMeta + ">#channel-header-links{display:none;}" +
150+
// Fix channel name size
151+
SelMeta + " #text.ytd-channel-name{font-size:24px;font-weight:400;}" +
152+
SelMeta + ">#channel-name{font-size:unset;line-height:unset;}" +
153+
// Part of subscribe button fix
154+
SelMeta + "{width:max-content;}" +
155+
// Fix misaligned badge
156+
SelMeta + ">#channel-name{display:flex;align-items:center;font-size:unset;line-height:unset;}" +
157+
SelMeta + ">#channel-name>ytd-badge-supported-renderer>div>yt-icon{margin-bottom:0px;}" +
158+
SelMeta + ">#channel-name>ytd-badge-supported-renderer{margin-left:8px;}" +
159+
// Header realignment
150160
"#channel-header-container.ytd-c4-tabbed-header-renderer{padding-top:0px;align-items:center;}" +
161+
"#inner-header-container.ytd-c4-tabbed-header-renderer{flex-direction:row;margin-top:0px;}" +
162+
// Avatar style fixes
151163
"#channel-header-container.ytd-c4-tabbed-header-renderer>#avatar{width:80px;height:80px;margin-bottom:0px;}" +
152-
"#inner-header-container.ytd-c4-tabbed-header-renderer{margin-top:0px;}"
164+
// Fixing tab styles:
165+
".yt-tab-shape-wiz__tab{padding:0 32px;font-family:Roboto,Noto,sans-serif;font-size:14px;font-weight:500;letter-spacing:0.007px;text-size-adjust:100%;text-transform:uppercase;white-space:nowrap;}" +
166+
"yt-tab-shape.yt-tab-shape-wiz{margin-right:0px;}" +
167+
".yt-tab-group-shape-wiz__slider{display:none;}" +
168+
".yt-tab-shape-wiz__tab-bar--tab-bar-selected{height:2px;background:#AAA;}" +
169+
//
170+
""
153171
: "") +
154172
(SeriStyleSettings.General.OldColors.Value ?
155173
"#channel-header.ytd-c4-tabbed-header-renderer, #tabs-inner-container.ytd-c4-tabbed-header-renderer{background:#181818;}" +

scripts/transformer-videopage.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ document.head.appendChild(DomUtils.BuildElement("style", {
5656
"#description-inner{margin:0px;}" +
5757
"#snippet>.ytd-text-inline-expander:not([id]){display:none;}" + // Better than nth-child
5858
"#expand-sizer{display:none;}" +
59+
"#ytd-watch-info-text{display:none;}" +
5960
// Old pfp style
6061
"#owner #avatar{width:48px;height:48px;max-width:48px;max-height:48px;margin-right:16px;}" +
6162
"#owner #avatar>#img{width:48px;height:48px;max-width:48px;max-height:48px;}" +
@@ -165,7 +166,7 @@ if (Views) {
165166
}));
166167
$("#title > ytd-badge-supported-renderer > div > span").innerText = "I AM CRINGE AND I WANT MONEY FOR MY CONTENT";
167168
const FuckThisURL = document.location.href;
168-
window.addEventListener("historychange", function(Deets) {
169+
window.addEventListener("historychange", function (Deets) {
169170
var URL = Deets.detail;
170171
if (URL != FuckThisURL) {
171172
console.log("[SeriStyle|Videopage] Hard reloading the page after sponsorship lock.");

update.firefox.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,15 @@
8282
"strict_min_version": "109"
8383
}
8484
}
85+
},
86+
{
87+
"version": "1.12.0",
88+
"update_link": "https://github.com/Alluseri/SeriStyle/releases/download/1.12.0/SeriStyle-1.12.0.xpi",
89+
"applications": {
90+
"gecko": {
91+
"strict_min_version": "109"
92+
}
93+
}
8594
}
8695
]
8796
}

0 commit comments

Comments
 (0)