Skip to content

Instantly share code, notes, and snippets.

@clintonhalpin
Created June 30, 2015 14:21
Show Gist options
  • Save clintonhalpin/2826f184b2387a458c0c to your computer and use it in GitHub Desktop.
Save clintonhalpin/2826f184b2387a458c0c to your computer and use it in GitHub Desktop.
Neck b
{
"name": "MyExtension",
"version": "1.0",
"manifest_version": 2,
"description": "Turn your avatar into a neckbeard",
"permissions": ["tabs", "http://*/*"],
"content_scripts": [
{
"matches": ["https://twitter.com/*", "https://github.com/*"],
"js": ["scripts.js"]
}
]
}
if(location.origin === "https://twitter.com") {
document.getElementsByClassName('DashboardProfileCard-avatarImage')[0].setAttribute('src', 'https://royal-crate.surge.sh/beard.JPG');
} else if(location.origin === "https://github.com") {
var avatars = document.getElementsByClassName('avatar');
console.log(avatars);
for(var i = 0; i < avatars.length; i++) {
console.log(avatars[i]);
avatars[i].setAttribute('src', 'https://royal-crate.surge.sh/beard.JPG');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment