Skip to content

Commit

Permalink
Closes #969
Browse files Browse the repository at this point in the history
  • Loading branch information
ParticleCore committed Mar 21, 2024
1 parent c0d4c1b commit 0c5c042
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
24 changes: 15 additions & 9 deletions src/chrome/js/background-inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -2009,15 +2009,21 @@ function mainScript(extensionId, SettingData, defaultSettings) {
const pageData = JSON.parse(matched);
const videosCountText = pageData?.header?.["c4TabbedHeaderRenderer"]?.["videosCountText"]?.["runs"]?.map((entry) => entry.text)?.join("");

if (videosCountText && subCount["textChanged_"] && subCount?.["text"]?.["simpleText"]) {

subCount["textChanged_"]?.({
runs: [
{text: subCount["text"]["simpleText"]},
{text: " ‧ "},
{text: videosCountText},
]
});
if (videosCountText && subCount?.["text"]?.["simpleText"]) {

if (subCount["textChanged_"]) {

subCount["textChanged_"]?.({
runs: [
{text: subCount["text"]["simpleText"]},
{text: " ‧ "},
{text: videosCountText},
]
});

} else if (subCount.textContent === subCount["text"]["simpleText"]) {
subCount.textContent = `${subCount["text"]["simpleText"]}${videosCountText}`;
}

const parent = subCount.parentElement;

Expand Down
24 changes: 15 additions & 9 deletions src/firefox/js/background-inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -2009,15 +2009,21 @@ function mainScript(extensionId, SettingData, defaultSettings) {
const pageData = JSON.parse(matched);
const videosCountText = pageData?.header?.["c4TabbedHeaderRenderer"]?.["videosCountText"]?.["runs"]?.map((entry) => entry.text)?.join("");

if (videosCountText && subCount["textChanged_"] && subCount?.["text"]?.["simpleText"]) {

subCount["textChanged_"]?.({
runs: [
{text: subCount["text"]["simpleText"]},
{text: " ‧ "},
{text: videosCountText},
]
});
if (videosCountText && subCount?.["text"]?.["simpleText"]) {

if (subCount["textChanged_"]) {

subCount["textChanged_"]?.({
runs: [
{text: subCount["text"]["simpleText"]},
{text: " ‧ "},
{text: videosCountText},
]
});

} else if (subCount.textContent === subCount["text"]["simpleText"]) {
subCount.textContent = `${subCount["text"]["simpleText"]}${videosCountText}`;
}

const parent = subCount.parentElement;

Expand Down

0 comments on commit 0c5c042

Please sign in to comment.