Merge branch 'master' into experimental

This commit is contained in:
Ajay Ramachandran
2019-07-30 18:20:27 -04:00
committed by GitHub
3 changed files with 11 additions and 7 deletions

View File

@@ -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();
}
}