From f6c9e8e235bfdaa3d1c89c584aaa40fa3897a41f Mon Sep 17 00:00:00 2001
From: Official Noob <31563761+OfficialNoob@users.noreply.github.com>
Date: Sun, 4 Aug 2019 18:47:07 +0100
Subject: [PATCH 01/26] Added getYouTubeVideoID
---
utils.js | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 utils.js
diff --git a/utils.js b/utils.js
new file mode 100644
index 00000000..c2803729
--- /dev/null
+++ b/utils.js
@@ -0,0 +1,11 @@
+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");
+ if (url.includes("/embed/")) {
+ //it is an embed, don't search for v
+ id = match[7];
+ }
+
+ return (match && match[7].length == 11) ? id : false;
+}
From aae099842663eb200e4939f5c53cb0411baad59d Mon Sep 17 00:00:00 2001
From: Official Noob <31563761+OfficialNoob@users.noreply.github.com>
Date: Sun, 4 Aug 2019 18:59:08 +0100
Subject: [PATCH 02/26] Added utils.js
---
manifest.json | 2 ++
1 file changed, 2 insertions(+)
diff --git a/manifest.json b/manifest.json
index 1fe36a7c..be3a2dc7 100644
--- a/manifest.json
+++ b/manifest.json
@@ -11,6 +11,7 @@
"all_frames": true,
"js": [
"config.js",
+ "utils.js",
"content.js",
"popup.js"
],
@@ -48,6 +49,7 @@
},
"background": {
"scripts":[
+ "utils.js",
"config.js",
"background.js"
]
From 5425c54fca2889fba9e59f862e869f492512195c Mon Sep 17 00:00:00 2001
From: Official Noob <31563761+OfficialNoob@users.noreply.github.com>
Date: Sun, 4 Aug 2019 18:59:51 +0100
Subject: [PATCH 03/26] Added utils.js
---
popup.html | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/popup.html b/popup.html
index be45142b..30195294 100644
--- a/popup.html
+++ b/popup.html
@@ -193,5 +193,6 @@
+
-