diff --git a/README.md b/README.md index 1a90287f..290296e4 100644 --- a/README.md +++ b/README.md @@ -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 \ No newline at end of file diff --git a/background.js b/background.js index 3997e50e..388d4cd3 100644 --- a/background.js +++ b/background.js @@ -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(); }); diff --git a/content-config.js.example b/config.js similarity index 68% rename from content-config.js.example rename to config.js index b7b454de..005793a7 100644 --- a/content-config.js.example +++ b/config.js @@ -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"; \ No newline at end of file +var serverAddress = "http://localhost"; \ No newline at end of file diff --git a/config.js.example b/config.js.example new file mode 100644 index 00000000..23cc0be3 --- /dev/null +++ b/config.js.example @@ -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"; \ No newline at end of file diff --git a/content.js b/content.js index a15885ae..d63b8fc5 100644 --- a/content.js +++ b/content.js @@ -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) { diff --git a/manifest.json b/manifest.json index 9c7a7dd6..5c8a5325 100644 --- a/manifest.json +++ b/manifest.json @@ -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",