Skip to content

Commit

Permalink
Prod, new & better true olds. Meow.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alluseri committed Aug 5, 2023
1 parent 2a192f9 commit d18c84f
Show file tree
Hide file tree
Showing 13 changed files with 146 additions and 28 deletions.
9 changes: 9 additions & 0 deletions bgworker.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,13 @@
return;
}
});
env.webNavigation.onHistoryStateUpdated.addListener(function(Data) {
if (Data == null || !Data.url.includes("youtube")) return;
try {
console.log(Data);
env.tabs.sendMessage(Data.tabId, { Operation: "SeriStyle_HistoryState", Args: [Data.url] });
} catch {
console.log("Receiving end error.", JSON.stringify(Data, null, "\t"));
}
});
})();
6 changes: 3 additions & 3 deletions html/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ document.addEventListener("DOMContentLoaded", async () => {
console.log(ex);
}

Language = SeriStyleSettings.SeriStyle.Language.Value;
Array.from(document.getElementsByClassName("localize")).forEach(Element => Element.innerText = window.SeriStyleLocales[Language].HTML[Element.id]);
var KLanguage = window.SeriStyleLocales[Language = SeriStyleSettings.SeriStyle.Language.Value] || window.SeriStyleLocales[Language = SeriStyleSettings.SeriStyle.Language.Value = "en-US"];
Array.from(document.getElementsByClassName("localize")).forEach(Element => Element.innerText = KLanguage.HTML[Element.id]);

if (!Fail) {
document.getElementById("btn-reset").onclick = () => {
Expand All @@ -138,7 +138,7 @@ document.addEventListener("DOMContentLoaded", async () => {
Nav.appendChild(DomUtils.BuildElement("button", {
className: "modern-tab",
value: "",
innerText: window.SeriStyleLocales[Language].Categories[Category],
innerText: KLanguage.Categories[Category],
navtab: Category,
onclick: function () {
Navigate(this.navtab);
Expand Down
2 changes: 1 addition & 1 deletion html/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div id="central-logo">
<img src="../icons/default64.png">
<span id="central-name">SeriStyle</span>
<span class="central-sub">v1.10.0</span>
<span class="central-sub">v1.11.0</span>
<span class="central-sub" id="storage-status"></span>
</div>
<div id="interactions">
Expand Down
2 changes: 1 addition & 1 deletion html/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ document.addEventListener('DOMContentLoaded', function () {
});
document.getElementById("low-i-debug").onclick = async () => {
var DebugInfo = [
"- SeriStyle v1.10.0",
"- SeriStyle v1.11.0",
"- " + navigator.userAgent,
"- " + StorageMode
];
Expand Down
5 changes: 3 additions & 2 deletions manifest.firefox.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "SeriStyle",
"author": "Nekoseri",
"version": "1.10.0",
"version": "1.11.0",
"description": "Bring the early-2021 UI back to YouTube!",
"icons": {
"16": "icons/default16.png",
Expand All @@ -18,7 +18,8 @@
"permissions": [
"tabs",
"storage",
"scripting"
"scripting",
"webNavigation"
],
"host_permissions": [
"*://www.youtube.com/*"
Expand Down
5 changes: 3 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "SeriStyle",
"author": "Nekoseri",
"version": "1.10.0",
"version": "1.11.0",
"description": "Bring the early-2021 UI back to YouTube!",
"icons": {
"16": "icons/default16.png",
Expand All @@ -18,7 +18,8 @@
"permissions": [
"tabs",
"storage",
"scripting"
"scripting",
"webNavigation"
],
"host_permissions": [
"*://www.youtube.com/*"
Expand Down
48 changes: 42 additions & 6 deletions scripts/defaults.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
this.SeriStyleMetaVersion = 1;
this.SeriStyleMetaVersion = 2;

this.SeriStyleLocales = {
"en-US": {
Expand All @@ -18,13 +18,11 @@ this.SeriStyleLocales = {
Advanced: "Advanced settings"
},
Messages: {
UpdateSettings: "SeriStyle was updated to version 1.10.0, which introduced new settings!\n\nDo you want to visit the settings page(opens in a new tab)?"
UpdateSettings: "SeriStyle was updated to version 1.11.0, which introduced new settings!\n\nDo you want to visit the settings page(opens in a new tab)?"
}
}
};



this.SeriStyleSettings = {
SeriStyle: {
Language: {
Expand Down Expand Up @@ -101,6 +99,12 @@ this.SeriStyleSettings = {
}
},
VideoPage: {
BlueAccent: {
Kind: 0,
Name: {
"en-US": "Old accent color on action bar"
}
},
HideDownloadButton: {
Kind: 0,
Name: {
Expand Down Expand Up @@ -211,6 +215,20 @@ this.SeriStyleSettings = {
"en-US": "Half the spaces around sorting buttons"
},
Value: true
},
NoSponsors: {
Kind: 0,
Name: {
"en-US": "Hide the \"Channel sponsors\" section"
},
Value: true
},
TrueOld: {
Kind: 0,
Name: {
"en-US": "True Old UI"
},
Value: true
}
},
Playlist: {
Expand Down Expand Up @@ -255,6 +273,17 @@ this.SeriStyleSettings = {
"en-US": "$ms"
}
},
OldIconInterval: {
Kind: 2,
Range: [0, 5000],
Name: {
"en-US": "Old icon observer update interval"
},
Value: 200,
Format: {
"en-US": "$ms"
}
},
VideoPageInterval: {
Kind: 2,
Range: [0, 5000],
Expand Down Expand Up @@ -337,6 +366,7 @@ this.DomUtils = {
}
};

this.GetExel = (Element) => btoa(Element?.querySelector("path")?.attributes.d?.value);
this.MatchesExel = (Element, ExelArg) => btoa(Element?.querySelector("path")?.attributes.d?.value) == ExelArg;
this.FindByExel = (Elements, ExelArg) => Elements.find(x => btoa(x?.querySelector("path")?.attributes.d?.value) == ExelArg);
this.FindAllByExel = (Elements, ExelArg) => Elements.filter(x => btoa(x?.querySelector("path")?.attributes.d?.value) == ExelArg);
Expand All @@ -352,8 +382,11 @@ this.ExelImmersive = "TTIxIDd2MTBIM1Y3aDE4bTEtMUgydjEyaDIwVjZ6TTExLjUgMnYzaDFWMm
this.ExelDonate = "TTExIDE3aDJ2LTFoMWMuNTUgMCAxLS40NSAxLTF2LTNjMC0uNTUtLjQ1LTEtMS0xaC0zdi0xaDRWOGgtMlY3aC0ydjFoLTFjLS41NSAwLTEgLjQ1LTEgMXYzYzAgLjU1LjQ1IDEgMSAxaDN2MUg5djJoMnYxem01LjUtMTVjLTEuNzQgMC0zLjQxLjg4L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0zLTEuMzgtMi4yMSAwLTQgMS43OS00IDRzMS43OSA0IDQgNCA0LTEuNzkgNC00VjhoNlY0aC03eg==";

this.SvgCreateClip = '<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="M8,7c0,0.55-0.45,1-1,1S6,7.55,6,7c0-0.55,0.45-1,1-1S8,6.45,8,7z M7,16c-0.55,0-1,0.45-1,1c0,0.55,0.45,1,1,1s1-0.45,1-1 C8,16.45,7.55,16,7,16z M10.79,8.23L21,18.44V20h-3.27l-5.76-5.76l-1.27,1.27C10.89,15.97,11,16.47,11,17c0,2.21-1.79,4-4,4 c-2.21,0-4-1.79-4-4c0-2.21,1.79-4,4-4c0.42,0,0.81,0.08,1.19,0.2l1.37-1.37l-1.11-1.11C8,10.89,7.51,11,7,11c-2.21,0-4-1.79-4-4 c0-2.21,1.79-4,4-4c2.21,0,4,1.79,4,4C11,7.43,10.91,7.84,10.79,8.23z M10.08,8.94L9.65,8.5l0.19-0.58C9.95,7.58,10,7.28,10,7 c0-1.65-1.35-3-3-3S4,5.35,4,7c0,1.65,1.35,3,3,3c0.36,0,0.73-0.07,1.09-0.21L8.7,9.55l0.46,0.46l1.11,1.11l0.71,0.71l-0.71,0.71 L8.9,13.91l-0.43,0.43l-0.58-0.18C7.55,14.05,7.27,14,7,14c-1.65,0-3,1.35-3,3c0,1.65,1.35,3,3,3s3-1.35,3-3 c0-0.38-0.07-0.75-0.22-1.12l-0.25-0.61L10,14.8l1.27-1.27l0.71-0.71l0.71,0.71L18.15,19H20v-0.15L10.08,8.94z M17.73,4H21v1.56 l-5.52,5.52l-2.41-2.41L17.73,4z M18.15,5l-3.67,3.67l1,1L20,5.15V5H18.15z" class="style-scope yt-icon"></path></g></svg>';
this.SvgAddToPlaylist = '<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="M14 10H2v2h12v-2zm0-4H2v2h12V6zm4 8v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zM2 16h8v-2H2v2z" class="style-scope yt-icon"></path></g></svg>';
Expand All @@ -363,4 +396,7 @@ this.SvgDislike = '<svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet"
this.SvgActionMenu = '<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"><circle cx="5" cy="12" r="2" class="style-scope yt-icon"></circle><circle cx="12" cy="12" r="2" class="style-scope yt-icon"></circle><circle cx="19" cy="12" r="2" class="style-scope yt-icon"></circle></g></svg>';
this.SvgSearch = '<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="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" class="style-scope yt-icon"></path></g></svg>';
this.SvgMic = '<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="M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z" class="style-scope yt-icon"></path></g></svg>';
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>';
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>';

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";
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";
20 changes: 13 additions & 7 deletions scripts/page-observer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ var Environment = this.browser || this.chrome;
}
})();

Environment.runtime.onMessage.addListener((Message) => {
if (Message.Operation != "SeriStyle_HistoryState") return;
var URL = Message.Args[0];
window.dispatchEvent(new CustomEvent("historychange", {detail: Message.Args[0]}));
});

var GeneralTransformerBurned = false;

var GT_Burn1 = false;
Expand Down Expand Up @@ -45,38 +51,38 @@ var PageObserver = new MutationObserver(async Mutations => {
});

var VideoPageInterval = setInterval(() => {
if (document.querySelector("div#owner") && document.querySelector(".view-count")) {
if (document.querySelector("div#owner") && (document.querySelector(".view-count") || document.querySelector("#title > ytd-badge-supported-renderer > div > span"))) {
Environment.runtime.sendMessage({ Operation: "SeriStyle_LoadScript", Args: ["scripts/transformer-videopage.js"] });
clearInterval(VideoPageInterval);
console.log("[SeriStyle|Observer] Burned transformer: Videopage.");
console.log("[SeriStyle|Interval] Burned transformer: Videopage.");
}
}, SeriStyleSettings.Advanced.VideoPageInterval.Value);
var PlaylistInterval = setInterval(() => {
if (document.querySelector("ytd-menu-renderer.ytd-playlist-header-renderer")) {
Environment.runtime.sendMessage({ Operation: "SeriStyle_LoadScript", Args: ["scripts/transformer-playlist.js"] });
clearInterval(PlaylistInterval);
console.log("[SeriStyle|Observer] Burned transformer: Playlist.");
console.log("[SeriStyle|Interval] Burned transformer: Playlist.");
}
}, SeriStyleSettings.Advanced.PlaylistInterval.Value);
var VideoPlayerInterval = setInterval(() => {
if (document.querySelector(".ytp-settings-menu>.ytp-panel>.ytp-panel-menu")) {
Environment.runtime.sendMessage({ Operation: "SeriStyle_LoadScript", Args: ["scripts/transformer-videoplayer.js"] });
clearInterval(VideoPlayerInterval);
console.log("[SeriStyle|Observer] Burned transformer: VideoPlayer.");
console.log("[SeriStyle|Interval] Burned transformer: VideoPlayer.");
}
}, SeriStyleSettings.Advanced.VideoPlayerInterval.Value);
var ChannelPageInterval = setInterval(() => {
if (document.querySelector("ytd-browse[page-subtype='channels'] #contents.ytd-rich-grid-renderer") && document.querySelector("ytd-browse[page-subtype='channels'] #header.ytd-rich-grid-renderer")) {
Environment.runtime.sendMessage({ Operation: "SeriStyle_LoadScript", Args: ["scripts/transformer-channelpage.js"] });
clearInterval(ChannelPageInterval);
console.log("[SeriStyle|Observer] Burned transformer: ChannelPage.");
console.log("[SeriStyle|Interval] Burned transformer: ChannelPage.");
}
}, SeriStyleSettings.Advanced.ChannelPageInterval.Value);

Environment.runtime.sendMessage({ Operation: "SeriStyle_LoadScript", Args: ["scripts/transformer-css.js"] });
console.log("[SeriStyle|Observer] Burned transformer: CSS.");
console.log("[SeriStyle|Direct] Burned transformer: CSS.");
Environment.runtime.sendMessage({ Operation: "SeriStyle_LoadScript", Args: ["scripts/transformer-launch.js"] });
console.log("[SeriStyle|Observer] Burned transformer: Launch.");
console.log("[SeriStyle|Direct] Burned transformer: Launch.");

PageObserver.observe(document.querySelector("ytd-app"), {
childList: true,
Expand Down
2 changes: 1 addition & 1 deletion scripts/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
SeriStyleSettings[Category][Setting].Value = Modified[Category][Setting];
} catch {
Modified[Category][Setting] = undefined;
console.log("Removed " + Category + "." + Setting + " due to absence in defaults.");
console.log("[SeriStyle|INFO] Removed " + Category + "." + Setting + " due to absence in defaults.");
}
}
} catch (ex) {
Expand Down
21 changes: 20 additions & 1 deletion scripts/transformer-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

var SelSubPassiveBtn = "#subscribe-button yt-button-shape>button";
var SelSubContainer = "yt-smartimation.ytd-subscribe-button-renderer"; // Alt: #subscribe-button yt-smartimation
var SelMeta = "#meta.ytd-c4-tabbed-header-renderer";
var SelMetaSpan = SelMeta+">span.meta-item";

// TODO: Merge general button styles
document.head.appendChild(DomUtils.BuildElement("style", {
Expand Down Expand Up @@ -136,7 +138,24 @@ document.head.appendChild(DomUtils.BuildElement("style", {
"ytd-playlist-video-renderer{border-radius:0px;}" +
//
""
)
) +

/* Channel Page */
(SeriStyleSettings.ChannelPage.TrueOld.Value ?
SelMetaSpan + "{margin:0;}" +
SelMetaSpan + ">#channel-handle{display:none;}" +
SelMetaSpan + ">#videos-count{display:none;}" +
SelMeta+">#channel-tagline{display:none;}" +
"#channel-header-container.ytd-c4-tabbed-header-renderer{padding-top:0px;align-items:center;}" +
"#channel-header-container.ytd-c4-tabbed-header-renderer>#avatar{width:80px;height:80px;margin-bottom:0px;}" +
"#inner-header-container.ytd-c4-tabbed-header-renderer{margin-top:0px;}"
: "") +
(SeriStyleSettings.General.OldColors.Value ?
"#channel-header.ytd-c4-tabbed-header-renderer, #tabs-inner-container.ytd-c4-tabbed-header-renderer{background:#181818;}" +
"ytd-browse[page-subtype='channels'] {background:#0F0F0F;}"
: "") +
(SeriStyleSettings.ChannelPage.NoSponsors.Value ? "ytd-recognition-shelf-renderer{display:none;}" : "") +
""
).replaceAll(/(?<!!important);/g, "!important;"),
"id": "seristyle-tf-css"
}));
12 changes: 12 additions & 0 deletions scripts/transformer-general.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var SelSearchIcon = "#search-icon-legacy>yt-icon.ytd-searchbox";
var SelMicIcon = "#voice-search-button yt-icon";
var SelMenuIcon = "#guide-icon.ytd-masthead";
var _;

document.head.appendChild(DomUtils.BuildElement("style", {
"innerText":
Expand All @@ -22,6 +23,17 @@ $(SelSearchIcon).innerHTML = SvgSearch;
$(SelMicIcon).innerHTML = SvgMic;
$(SelMenuIcon).innerHTML = SvgMenu;

setInterval(function() { // It's not my problem that everyone is stupid enough not to fix Subtree MutationObserver for the whole existence of this class
$$("path").forEach(Element => {
var Exel = btoa(Element.attributes.d?.value);
if (Exel == ExelVerified) {
Element.attributes.d.value = PathVerified;
} else if (Exel == ExelProducer) {
Element.attributes.d.value = PathProducer;
}
});
}, SeriStyleSettings.Advanced.OldIconInterval.Value);

function FixContentHTML(Element, Metadata) {
console.log(Element);
console.log(Metadata);
Expand Down
Loading

0 comments on commit d18c84f

Please sign in to comment.