mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2026-01-30 06:10:55 +03:00
Update ContentScript.js
This commit is contained in:
@@ -1,8 +1,7 @@
|
|||||||
chrome.runtime.onMessage.addListener(
|
chrome.runtime.onMessage.addListener(
|
||||||
function(request, sender, sendResponse) {
|
function(request, sender, sendResponse) {
|
||||||
if (request.message === 'ytvideo') {
|
if (request.message === 'ytvideoid') {
|
||||||
video_id = youtube_parser(document.URL);
|
SponsorsLookup(request.id);
|
||||||
SponsorsLookup(video_id);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -28,9 +27,3 @@ function SponsorCheck() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function youtube_parser(url) {
|
|
||||||
var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;
|
|
||||||
var match = url.match(regExp);
|
|
||||||
return (match && match[7].length == 11) ? match[7] : false;
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user