Added support for Firefox.

This commit is contained in:
Ajay Ramachandran
2019-07-22 21:11:37 -04:00
parent 1040868ebb
commit 21220bf2d3
3 changed files with 17 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
.playerButton {
.playerButtonImage {
height: 60%;
top: 0;
bottom: 0;
@@ -6,6 +6,10 @@
margin: auto;
}
.playerButton {
vertical-align: top;
}
.sponsorSkipObject {
font-family: 'Source Sans Pro', sans-serif;
}

View File

@@ -117,7 +117,6 @@ function videoIDChange(id) {
function sponsorsLookup(id) {
v = document.querySelector('video') // Youtube video player
let xmlhttp = new XMLHttpRequest();
//check database for sponsor times
sendRequestToServer('GET', "/api/getVideoSponsorTimes?videoID=" + id, function(xmlhttp) {
@@ -193,13 +192,13 @@ function addPlayerControlsButton() {
let startSponsorButton = document.createElement("button");
startSponsorButton.id = "startSponsorButton";
startSponsorButton.className = "ytp-button";
startSponsorButton.className = "ytp-button playerButton";
startSponsorButton.setAttribute("title", "Sponsor Starts Now");
startSponsorButton.addEventListener("click", startSponsorClicked);
let startSponsorImage = document.createElement("img");
startSponsorImage.id = "startSponsorImage";
startSponsorImage.className = "playerButton";
startSponsorImage.className = "playerButtonImage";
startSponsorImage.src = chrome.extension.getURL("icons/PlayerStartIconSponsorBlocker256px.png");
//add the image to the button
@@ -269,7 +268,7 @@ function addSubmitButton() {
//make a submit button
let submitButton = document.createElement("button");
submitButton.id = "submitButton";
submitButton.className = "ytp-button";
submitButton.className = "ytp-button playerButton";
submitButton.setAttribute("title", "Submit Sponsor Times");
submitButton.addEventListener("click", submitSponsorTimes);
//hide it at the start
@@ -277,7 +276,7 @@ function addSubmitButton() {
let submitImage = document.createElement("img");
submitImage.id = "submitButtonImage";
submitImage.className = "playerButton";
submitImage.className = "playerButtonImage";
submitImage.src = chrome.extension.getURL("icons/PlayerUploadIconSponsorBlocker256px.png");
//add the image to the button

View File

@@ -30,7 +30,8 @@
"permissions": [
"tabs",
"storage",
"notifications"
"notifications",
"https://sponsor.ajay.app/*"
],
"browser_action": {
"default_title": "SponsorBlock",
@@ -49,5 +50,11 @@
"128": "icons/LogoSponsorBlocker128px.png",
"256": "icons/LogoSponsorBlocker256px.png"
},
"browser_specific_settings": {
"gecko": {
"id": "sponsorBlocker@ajay.app",
"strict_min_version": "42.0"
}
},
"manifest_version": 2
}