Skip to content

Instantly share code, notes, and snippets.

@Shaked
Created May 5, 2018 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shaked/e431fa7f3586c2b41165068784e7de75 to your computer and use it in GitHub Desktop.
Save Shaked/e431fa7f3586c2b41165068784e7de75 to your computer and use it in GitHub Desktop.
Skip specific youtube videos by their names
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);
});
{
"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