Skip to content

Commit

Permalink
Closes #965
Browse files Browse the repository at this point in the history
  • Loading branch information
ParticleCore committed Mar 21, 2024
1 parent 99bbe66 commit 6d1b807
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 2 deletions.
29 changes: 28 additions & 1 deletion src/chrome/js/background-inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -1850,7 +1850,7 @@ function mainScript(extensionId, SettingData, defaultSettings) {
|| (!iridiumSettings.subscriptionsShorts && window.location.pathname === "/feed/subscriptions")
) {

// home page and subscriptions shorts
// home page and grid view subscriptions shorts
const richGridRenderer = Util.getSingleObjectByKey(data, "richGridRenderer");
const richGridRendererContents = richGridRenderer?.["contents"];

Expand All @@ -1877,6 +1877,33 @@ function mainScript(extensionId, SettingData, defaultSettings) {
}
}

// list view subscriptions shorts
const sectionListRenderer = Util.getSingleObjectByKey(data, "sectionListRenderer");
const sectionListRendererContents = sectionListRenderer?.["contents"];

if (sectionListRendererContents?.constructor === Array && sectionListRendererContents.length > 0) {
for (let i = sectionListRendererContents.length - 1; i >= 0; i--) {

const itemSectionRendererContents = sectionListRendererContents[i]?.["itemSectionRenderer"]?.["contents"];

if (itemSectionRendererContents?.constructor === Array && itemSectionRendererContents.length > 0) {

for (let j = itemSectionRendererContents.length - 1; j >= 0; j--) {
const reelShelfRenderer = itemSectionRendererContents[j]?.["reelShelfRenderer"];
if (reelShelfRenderer) {
itemSectionRendererContents.splice(j, 1);
}
}

if (itemSectionRendererContents.length === 0) {
sectionListRendererContents.splice(i, 1);
}

}

}
}

}


Expand Down
29 changes: 28 additions & 1 deletion src/firefox/js/background-inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -1850,7 +1850,7 @@ function mainScript(extensionId, SettingData, defaultSettings) {
|| (!iridiumSettings.subscriptionsShorts && window.location.pathname === "/feed/subscriptions")
) {

// home page and subscriptions shorts
// home page and grid view subscriptions shorts
const richGridRenderer = Util.getSingleObjectByKey(data, "richGridRenderer");
const richGridRendererContents = richGridRenderer?.["contents"];

Expand All @@ -1877,6 +1877,33 @@ function mainScript(extensionId, SettingData, defaultSettings) {
}
}

// list view subscriptions shorts
const sectionListRenderer = Util.getSingleObjectByKey(data, "sectionListRenderer");
const sectionListRendererContents = sectionListRenderer?.["contents"];

if (sectionListRendererContents?.constructor === Array && sectionListRendererContents.length > 0) {
for (let i = sectionListRendererContents.length - 1; i >= 0; i--) {

const itemSectionRendererContents = sectionListRendererContents[i]?.["itemSectionRenderer"]?.["contents"];

if (itemSectionRendererContents?.constructor === Array && itemSectionRendererContents.length > 0) {

for (let j = itemSectionRendererContents.length - 1; j >= 0; j--) {
const reelShelfRenderer = itemSectionRendererContents[j]?.["reelShelfRenderer"];
if (reelShelfRenderer) {
itemSectionRendererContents.splice(j, 1);
}
}

if (itemSectionRendererContents.length === 0) {
sectionListRendererContents.splice(i, 1);
}

}

}
}

}


Expand Down

0 comments on commit 6d1b807

Please sign in to comment.