Skip to content

Commit 0c5c042

Browse files
committed
Closes #969
1 parent c0d4c1b commit 0c5c042

File tree

2 files changed

+30
-18
lines changed

2 files changed

+30
-18
lines changed

src/chrome/js/background-inject.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2009,15 +2009,21 @@ function mainScript(extensionId, SettingData, defaultSettings) {
20092009
const pageData = JSON.parse(matched);
20102010
const videosCountText = pageData?.header?.["c4TabbedHeaderRenderer"]?.["videosCountText"]?.["runs"]?.map((entry) => entry.text)?.join("");
20112011

2012-
if (videosCountText && subCount["textChanged_"] && subCount?.["text"]?.["simpleText"]) {
2013-
2014-
subCount["textChanged_"]?.({
2015-
runs: [
2016-
{text: subCount["text"]["simpleText"]},
2017-
{text: " ‧ "},
2018-
{text: videosCountText},
2019-
]
2020-
});
2012+
if (videosCountText && subCount?.["text"]?.["simpleText"]) {
2013+
2014+
if (subCount["textChanged_"]) {
2015+
2016+
subCount["textChanged_"]?.({
2017+
runs: [
2018+
{text: subCount["text"]["simpleText"]},
2019+
{text: " ‧ "},
2020+
{text: videosCountText},
2021+
]
2022+
});
2023+
2024+
} else if (subCount.textContent === subCount["text"]["simpleText"]) {
2025+
subCount.textContent = `${subCount["text"]["simpleText"]}${videosCountText}`;
2026+
}
20212027

20222028
const parent = subCount.parentElement;
20232029

src/firefox/js/background-inject.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2009,15 +2009,21 @@ function mainScript(extensionId, SettingData, defaultSettings) {
20092009
const pageData = JSON.parse(matched);
20102010
const videosCountText = pageData?.header?.["c4TabbedHeaderRenderer"]?.["videosCountText"]?.["runs"]?.map((entry) => entry.text)?.join("");
20112011

2012-
if (videosCountText && subCount["textChanged_"] && subCount?.["text"]?.["simpleText"]) {
2013-
2014-
subCount["textChanged_"]?.({
2015-
runs: [
2016-
{text: subCount["text"]["simpleText"]},
2017-
{text: " ‧ "},
2018-
{text: videosCountText},
2019-
]
2020-
});
2012+
if (videosCountText && subCount?.["text"]?.["simpleText"]) {
2013+
2014+
if (subCount["textChanged_"]) {
2015+
2016+
subCount["textChanged_"]?.({
2017+
runs: [
2018+
{text: subCount["text"]["simpleText"]},
2019+
{text: " ‧ "},
2020+
{text: videosCountText},
2021+
]
2022+
});
2023+
2024+
} else if (subCount.textContent === subCount["text"]["simpleText"]) {
2025+
subCount.textContent = `${subCount["text"]["simpleText"]}${videosCountText}`;
2026+
}
20212027

20222028
const parent = subCount.parentElement;
20232029

0 commit comments

Comments
 (0)