Skip to content

Commit 29f9ea0

Browse files
committed
reddit: hide multi-reddits (custom feeds) by default
1 parent c842b45 commit 29f9ea0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

reddit.com/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ sheet.type = "text/css";
1212
sheet.innerText = styles;
1313
document.head.appendChild(sheet);
1414

15+
// hide multi-reddits by default
16+
setTimeout(() => {
17+
const customFeeds = document.querySelector('[aria-controls="multireddits_section"]');
18+
if (customFeeds.ariaExpanded === 'true') {
19+
customFeeds.click();
20+
}
21+
}, 500);
22+
1523
// Select the node that will be observed for mutations
1624
const targetNode = document.querySelector(".ListingLayout-outerContainer");
1725

@@ -34,6 +42,7 @@ const observer = new MutationObserver((mutations, _) => {
3442

3543
observer.observe(targetNode, config);
3644

45+
3746
/**
3847
*
3948
*/
@@ -43,6 +52,7 @@ function run_it(node = document) {
4352
return;
4453
}
4554

55+
4656
const sections = location.pathname.split(/(?!^)\//);
4757
const loc = sections[0];
4858
if (["/user", "/r"].includes(loc)) {

0 commit comments

Comments
 (0)