Moved requests to the background script.

This should avoid ad blockers messing with requests.

Helps with https://github.com/ajayyy/SponsorBlock/issues/354
This commit is contained in:
Ajay Ramachandran
2020-05-24 22:42:55 -04:00
parent f165b3b602
commit 39155fdf99
6 changed files with 120 additions and 86 deletions

View File

@@ -268,7 +268,7 @@ async function migrateOldFormats() {
let response = await utils.asyncRequestToCustomServer("GET", "https://sponsor.ajay.app/invidious/api/v1/channels/" + item.split("/")[2] + "?fields=authorId");
if (response.ok) {
newChannelList.push((await response.json()).authorId);
newChannelList.push((JSON.parse(response.responseText)).authorId);
} else {
// Add it at the beginning so it gets converted later
newChannelList.unshift(item);