From fadb294c98a82efb81bf6b7213028c7456af5dbf Mon Sep 17 00:00:00 2001
From: Ajay Ramachandran
Date: Tue, 13 Aug 2019 14:05:32 -0400
Subject: [PATCH 1/6] Made the preview bar only get created if a video is
found.
---
content.js | 12 ++++++++----
manifest.json | 2 +-
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/content.js b/content.js
index 868c8ddf..690bb77e 100644
--- a/content.js
+++ b/content.js
@@ -25,10 +25,9 @@ var channelURL;
var channelWhitelisted = false;
// create preview bar
-let progressBar = document.getElementsByClassName("ytp-progress-bar-container")[0] || document.getElementsByClassName("no-model cue-range-markers")[0];
-var previewBar = new PreviewBar(progressBar);
+var previewBar;
-if(id = getYouTubeVideoID(document.URL)){ // Direct Links
+if (id = getYouTubeVideoID(document.URL)) { // Direct Links
videoIDChange(id);
}
@@ -203,10 +202,15 @@ document.onkeydown = function(e){
}
function videoIDChange(id) {
-
//not a url change
if (sponsorVideoID == id) return;
+ if (previewBar == null) {
+ //create it
+ let progressBar = document.getElementsByClassName("ytp-progress-bar-container")[0] || document.getElementsByClassName("no-model cue-range-markers")[0];
+ previewBar = new PreviewBar(progressBar);
+ }
+
//warn them if they had unsubmitted times
if (previousVideoID != null) {
//get the sponsor times from storage
diff --git a/manifest.json b/manifest.json
index d71a7f4b..5b7847c6 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,7 +1,7 @@
{
"name": "SponsorBlock for YouTube - Skip Sponsorships",
"short_name": "SponsorBlock",
- "version": "1.0.35",
+ "version": "1.0.36",
"description": "Skip over sponsorship on YouTube videos. Report sponsors on videos you watch to save the time of others.",
"content_scripts": [
{
From 60fc61560d6cb581654497abf0b9a78500223e1d Mon Sep 17 00:00:00 2001
From: Ajay Ramachandran
Date: Tue, 13 Aug 2019 14:39:20 -0400
Subject: [PATCH 2/6] Added leaderboard link
---
popup.css | 4 ++++
popup.html | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/popup.css b/popup.css
index 1d5dd91e..ae3f79dc 100644
--- a/popup.css
+++ b/popup.css
@@ -51,6 +51,10 @@ h1.popupElement {
padding: 5px;
}
+.discreteLink.popupElement {
+ color: black;
+}
+
.recordingSubtitle.popupElement {
margin-bottom: 10px;
}
diff --git a/popup.html b/popup.html
index 0c829494..039db0e2 100644
--- a/popup.html
+++ b/popup.html
@@ -73,6 +73,10 @@
sponsor segments.
+
+