mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-12 06:27:14 +03:00
Merge branch 'master' into experimental
This commit is contained in:
12
popup.js
12
popup.js
@@ -943,10 +943,11 @@ function runThePopup() {
|
||||
xmlhttp.send();
|
||||
}
|
||||
|
||||
function getYouTubeVideoID(url) { // Return video id or false
|
||||
let regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;
|
||||
let match = url.match(regExp);
|
||||
return (match && match[7].length == 11) ? match[7] : false;
|
||||
function getYouTubeVideoID(url) { // Returns with video id else returns false
|
||||
var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;
|
||||
var match = url.match(regExp);
|
||||
var id = new URL(url).searchParams.get("v");
|
||||
return (match && match[7].length == 11) ? id : false;
|
||||
}
|
||||
|
||||
//end of function
|
||||
@@ -958,4 +959,5 @@ if (chrome.tabs != undefined) {
|
||||
|
||||
//this means it is actually opened in the popup
|
||||
runThePopup();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user