Merge pull request #18 from StuffNoOneCaresAbout/master

Remove cors-anywhere
This commit is contained in:
kodxana 2020-07-06 09:31:38 +02:00 committed by GitHub
commit 2f91e320a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -4,6 +4,7 @@
"permissions": [ "permissions": [
"https://www.youtube.com/watch?v=*", "https://www.youtube.com/watch?v=*",
"https://www.youtube.com/channel/*", "https://www.youtube.com/channel/*",
"https://api.lbry.com/*",
"tabs", "tabs",
"storage" "storage"
], ],

View file

@ -5,7 +5,7 @@ chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
const { id, type } = getId(tab.url); const { id, type } = getId(tab.url);
if (!id) return; if (!id) return;
const url = `https://cors-anywhere.herokuapp.com/https://api.lbry.com/yt/resolve?${type}_ids=${id}`; const url = `https://api.lbry.com/yt/resolve?${type}_ids=${id}`;
const response = await fetch(url, { headers: { 'Content-Type': 'application/json' } }); const response = await fetch(url, { headers: { 'Content-Type': 'application/json' } });
const json = await response.json(); const json = await response.json();
console.log(json); console.log(json);