Skip to content

Instantly share code, notes, and snippets.

@aleph-naught2tog
Last active December 20, 2019 01:04
Show Gist options
  • Save aleph-naught2tog/e02a85e0f16a39613d576431f5577ba1 to your computer and use it in GitHub Desktop.
Save aleph-naught2tog/e02a85e0f16a39613d576431f5577ba1 to your computer and use it in GitHub Desktop.
Delete non video stuff from CNN page
const selectorsToRemove = [
'._7eda40eb._34e5cb16._4564d500',
'footer',
'.ls-event-tray._8926d01d',
'._56b5b25c',
'._4b262fa5',
'._3be0fd6a',
'.Box-sc-1fet97o-0.outbrain__Container-oos1px-0.cnBIwK',
'.courageous_pushdown_element',
'[class^="template-basestyles__AdSlot"]' // big top ad video in FF
];
selectorsToRemove.forEach(selector => {
const element = document.querySelector(selector);
if (element) {
element.remove();
}
});
// remove the weird little spacer divs
[
'.Box-sc-1fet97o-0.cOxGLR',
'.Box-sc-1fet97o-0.bRFjwV',
'.Box-sc-1fet97o-0.kquQLB',
].forEach(selector => {
const element = document.querySelector(selector);
if (element) {
element.style.padding = 0;
const divs = document.querySelectorAll(`${selector} > div`);
[...divs].forEach(div => div.remove());
}
});
// make things teeny
// yes, `undefined` really is the other class on this element
document.querySelector('.f56c47ff.undefined').style.padding = 0;
// resize
document.querySelector('.ddd0e023').style.width = '93vw';
@aleph-naught2tog
Copy link
Author

aleph-naught2tog commented Oct 16, 2019

By and large copying and pasting random Javascript into your console is a poor idea, and I have no way to confirm I'm not sketchy, but I can at least offer documentation for the methods used above:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment