mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 01:01:55 +01:00
Updated background.js to use config server as well
This commit is contained in:
parent
598e15203b
commit
a1d51656c5
6 changed files with 13 additions and 7 deletions
|
@ -21,8 +21,8 @@ This project is partially based off of [this experimental extension](https://git
|
|||
|
||||
# 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
|
||||
|
||||
None at the moment
|
||||
None at the moment
|
|
@ -92,7 +92,7 @@ function submitTimes(videoID) {
|
|||
|
||||
let userIDStorage = getUserID(function(userIDStorage) {
|
||||
//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);
|
||||
xmlhttp.send();
|
||||
});
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
//this file is loaded along iwth content.js
|
||||
//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();
|
||||
|
||||
//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 () {
|
||||
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
"https://*.youtube.com/*"
|
||||
],
|
||||
"js": [
|
||||
"content-config.js",
|
||||
"config.js",
|
||||
"content.js"
|
||||
],
|
||||
"css": [
|
||||
|
@ -33,7 +33,10 @@
|
|||
"default_popup": "popup.html"
|
||||
},
|
||||
"background": {
|
||||
"scripts":["background.js"]
|
||||
"scripts":[
|
||||
"config.js",
|
||||
"background.js"
|
||||
]
|
||||
},
|
||||
"icons": {
|
||||
"16": "icons/IconSponsorBlocker16px.png",
|
||||
|
|
Loading…
Reference in a new issue