Use the Twitch JSON API
Please take a look to my solution. This challenge was a bit difficult because I did not find any usable project… Even the example page don’t work.
I have also several error on console:
- on live page:
Failed to load ‘’ as a plugin, because the frame into which the plugin is loading is sandboxed.
- If I click on twitchTV icon (right-bottom) I get the same error like on the example page:
Uncaught DOMException: Failed to set the ‘domain’ property on ‘Document’: Assignment is forbidden for sandboxed iframes.
but on localhost I don’t get the above error. The twitchTV site open on new tab as well.
- on localhost:
GET chrome-extension://invalid/ net::ERR_FAILED
I have not idea how to fix these errors… , but the app is running.
You can add new user to the list, or delete anyone or filter online/offline and also is it responsive… Try on mobile too or resize the window.
-------------------------------------- Updated -------------------------------------------------
I found a solutions to fix the second error: Assignment is forbidden for sandboxed iframes.
Ones the iframe element rendered have to add an attribute to the iframe:
document.getElementsByTagName("iframe")[0].setAttribute("sandbox", "allow-scripts allow-top-navigation");
Now if click on twitchTV icon it’s open the channel in new tab…
Left of more two issue…
Code modified at 29. May 2020.
From 1th of May is a must to send access token if we want to send get request to the helix endpoints. I modified the following:
- I completed the AJAX method: now it is handle also POST request. We need send POST request to get an access token.
- I completed also the AJAX object with the “Authorization” header.
After these two modify my project works well again…