Skip to content

Instantly share code, notes, and snippets.

@silviapfeiffer
Created November 26, 2012 07:53
Show Gist options
  • Save silviapfeiffer/4147094 to your computer and use it in GitHub Desktop.
Save silviapfeiffer/4147094 to your computer and use it in GitHub Desktop.
Exposing first article element based on Miketay's gist https://gist.github.com/4032962
// ==UserScript==
// @include http://*/*
// @include https://*/*
// ==/UserScript==
//applies a "main-content" style to the first article element
var style = document.createElement('style');
style.innerHTML = ".main-content {outline: 5px dotted deeppink !important;}"
document.body.appendChild(style);
var kids = [].slice.apply(document.body.children);
for (var i = 0, l = kids.length; i < l; i++) {
switch(kids[i].tagName.toLowerCase()){
case "article":
kids[i].classList.add('main-content');
break;
default:
break;
}
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment