Created
May 5, 2018 03:39
-
-
Save Shaked/e431fa7f3586c2b41165068784e7de75 to your computer and use it in GitHub Desktop.
Skip specific youtube videos by their names
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
console.log('SKIPYOUTUBE: before ready'); | |
var skippedList = [ | |
'שלמה ארצי' | |
]; | |
function run() { | |
var videoName = $('#info-contents h1').text(); | |
console.log('SKIPYOUTUBE: run started, videoName: ', videoName); | |
if (!videoName) { | |
setTimeout(run, 300); | |
return; | |
} | |
for (var i in skippedList) { | |
var name = skippedList[i]; | |
console.log('SKIPYOUTUBE: looking for name: ', name); | |
if (videoName.indexOf(name) > -1) { | |
console.log('SKIPYOUTUBE: Found!', videoName); | |
document.location.href = $('#dismissable a').attr('href'); | |
return; | |
} | |
} | |
}; | |
$(document).ready(function() { | |
console.log('SKIPYOUTUBE: ready1'); | |
setTimeout(run, 300); | |
}); |
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
{ | |
"manifest_version": 2, | |
"name": "SkipYoutubeVideo", | |
"version": "0.0.0.1", | |
"description": "SkipYoutubeVideo ", | |
"icons": { | |
"16": "icon16.png", | |
"48": "icon48.png", | |
"128": "icon128.png" | |
}, | |
"content_scripts": [ | |
{ | |
"css": [ | |
"style.css" | |
], | |
"js": [ | |
"/node_modules/jquery/dist/jquery.min.js", | |
"content.js" | |
], | |
"matches": [ | |
"https://youtube.com/*", | |
"https://www.youtube.com/*" | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment