Code for a Chrome extension that will bypass Upworthy's blogspam and go directly to the embedded Youtube video.
Last active
August 29, 2015 14:02
-
-
Save craigmaslowski/233494258a9ca4503c77 to your computer and use it in GitHub Desktop.
Upworthy Blogspam Killer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var iframes = document.getElementsByTagName('iframe'), | |
src; | |
for (var i = 0; i < iframes.length; i++) { | |
src = iframes[i].src; | |
if (/\/embed\//.test(src)) { | |
var videoId = src.substring(src.indexOf('embed/')+6, src.indexOf('?')); | |
window.location.href = 'http://youtube.com/watch?v=' + videoId; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Skip Upworthy", | |
"version": "0.0.1", | |
"manifest_version": 2, | |
"description": "Skip Upworthy", | |
"homepage_url": "http://google.com", | |
"default_locale": "en", | |
"content_scripts": [ | |
{ | |
"matches": [ | |
"*://www.upworthy.com/*", | |
"*://upworthy.com/*" | |
], | |
"js": [ "buhbye.js" ] | |
} | |
], | |
"permissions": ["activeTab"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment