mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 12:07:11 +03:00
Updated background.js to use config server as well
This commit is contained in:
@@ -21,7 +21,7 @@ This project is partially based off of [this experimental extension](https://git
|
|||||||
|
|
||||||
# Chrome extension
|
# Chrome extension
|
||||||
|
|
||||||
It will be on the chrome webstore soon once I get some more UI features in, such as an icon. For now, you can load this project as an unpacked extension. Make sure to rename the `content-config.js.example` file to `content-config.js` before installing.
|
It will be on the chrome webstore soon once I get some more UI features in, such as an icon. For now, you can load this project as an unpacked extension. Make sure to rename the `config.js.example` file to `config.js` before installing.
|
||||||
|
|
||||||
# Firefox extension
|
# Firefox extension
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ function submitTimes(videoID) {
|
|||||||
|
|
||||||
let userIDStorage = getUserID(function(userIDStorage) {
|
let userIDStorage = getUserID(function(userIDStorage) {
|
||||||
//submit the sponsorTime
|
//submit the sponsorTime
|
||||||
xmlhttp.open('GET', 'http://localhost/api/postVideoSponsorTimes?videoID=' + videoID + "&startTime=" + sponsorTimes[i][0] + "&endTime=" + sponsorTimes[i][1]
|
xmlhttp.open('GET', serverAddress + "/api/postVideoSponsorTimes?videoID=" + videoID + "&startTime=" + sponsorTimes[i][0] + "&endTime=" + sponsorTimes[i][1]
|
||||||
+ "&userID=" + userIDStorage, true);
|
+ "&userID=" + userIDStorage, true);
|
||||||
xmlhttp.send();
|
xmlhttp.send();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
//this file is loaded along iwth content.js
|
//this file is loaded along iwth content.js
|
||||||
//this file sets the server to connect to, and is gitignored
|
//this file sets the server to connect to, and is gitignored
|
||||||
var serverAddresss = "https://sponsor.ajay.app";
|
var serverAddress = "http://localhost";
|
||||||
3
config.js.example
Normal file
3
config.js.example
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
//this file is loaded along iwth content.js
|
||||||
|
//this file sets the server to connect to, and is gitignored
|
||||||
|
var serverAddress = "https://sponsor.ajay.app";
|
||||||
@@ -114,7 +114,7 @@ function sponsorsLookup(id) {
|
|||||||
let xmlhttp = new XMLHttpRequest();
|
let xmlhttp = new XMLHttpRequest();
|
||||||
|
|
||||||
//check database for sponsor times
|
//check database for sponsor times
|
||||||
xmlhttp.open('GET', serverAddresss + "/api/getVideoSponsorTimes?videoID=" + id, true);
|
xmlhttp.open('GET', serverAddress + "/api/getVideoSponsorTimes?videoID=" + id, true);
|
||||||
|
|
||||||
xmlhttp.onreadystatechange = function () {
|
xmlhttp.onreadystatechange = function () {
|
||||||
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
|
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"https://*.youtube.com/*"
|
"https://*.youtube.com/*"
|
||||||
],
|
],
|
||||||
"js": [
|
"js": [
|
||||||
"content-config.js",
|
"config.js",
|
||||||
"content.js"
|
"content.js"
|
||||||
],
|
],
|
||||||
"css": [
|
"css": [
|
||||||
@@ -33,7 +33,10 @@
|
|||||||
"default_popup": "popup.html"
|
"default_popup": "popup.html"
|
||||||
},
|
},
|
||||||
"background": {
|
"background": {
|
||||||
"scripts":["background.js"]
|
"scripts":[
|
||||||
|
"config.js",
|
||||||
|
"background.js"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"icons": {
|
"icons": {
|
||||||
"16": "icons/IconSponsorBlocker16px.png",
|
"16": "icons/IconSponsorBlocker16px.png",
|
||||||
|
|||||||
Reference in New Issue
Block a user