I’m a beginner in Twitch extension development, I have just downloaded the Hello World extension and uploaded the .zip file by creating a new extension in my twitch developer account. Now the panel is coming on my channel but getting this error “Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”).” in the console and js functionalities are not working. I have tried a lot but unable to find out the reason. Can anyone please help me out of this problem?
This looks like the older hello world.
Extensions in hosted test cannot use jQuery (and other libraries from a CDN).
Try the hello world obtained via the Native rig which is more up to date.
Where did you obtain this hello world from so we can go fix it?
Thank you. My problem is solved. It’s now working. But I have a query here, can I open a new window having a 3rd party web url, by clicking a button within the Twitch extension using js?
Yes. But there are rules
Ok. But I’m getting an error can you please check the screenshot and help me to understand this error. here is the screenshot.
You are building a shopping cart?
Thats in violation of 4.5 and 5.3
But I have got a similar here https://www.twitch.tv/fuzzface49
I can see that extension is fully functional, and pops open a popup window.
Seems weird you already have a working extension but now having problems with hello world…
The errors in your screenshot have nothing to do with Twitch Extensions they indicate issues with the cart JS Library
No that extension is just a reference and I’m just trying to make an extension like that.
Ok if it has nothing to do with Twitch extensions, I will check the cart js.
Thank you @BarryCarlyon.
I imagine Faze have a special dispensation. As shopping carts are against the rules as per section 5
5.3 Extensions may not transact or encourage the transacting of monetary exchange in relation to any non-Twitch/Amazon commerce instruments.
Ok, then what should I do to get special dispensation ? can you please tell me.
I don’t know. As I don’t have it myself
Can you guide me for connecting my external database with my twitch extension ? I want to use php for the extension backend service what are the steps I should follow?
A twitch extension cannot natively access a database, your extension would have to make a ajax call to your EBS and the EBS performs the DB looking up returning that data.
ok, but how to connect a 3rd party EBS inside my twitch extension, what are the steps for that? Can you please guide?
I answered that already
Ok, thank you.
I’m getting error while calling ajax to a 3rd party url in my js “Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource”. What is the reason for that?
You didn’t set CORS headers on your EBS to permitted CORS to operate
I have tried to set using the code below
‘Access-Control-Allow-Origin’: ’ * ',
‘Access-Control-Request-Headers’: ’ * ',
But it’s not working. Can you please help?