Hello! I’m having some issues with adding a Twitch embed for my electron app. In development, using parent=localhost works fine, but this is an issue when the app is packaged and runs with file:// as the directive. I tried using the electron example with deleting the responseHeader, but this is not working for me. The content security policy header remains.
As a last resort, I tried following instructions from this thread: How will Twitch Embed updates affect mobile app embeds? - API - Twitch Developer Forums. I created a static webpage to serve a twitch video. I then used an iframe to view the webpage, and set the parent to the static webpage. This still results in an issue with the CSP. Is there any way to get a Twitch embed working on a packaged electron app? Thank you in advance.
Your issues suggests you are using an outdated version of electron, (the method changed in a recent version slightly iirc) or you are not binding your removal function corretly.
For completeness I also adjusted my github example to build/become packaged, and this is the result: working fine.
Hi Barry! Thanks for your response. I figured out the issue and it was related to electron store for whatever reason. I had a call to electron.store.set right before the logic for removing the header. It must’ve caused a race condition? This only happened when the app was packaged, and also seemed to work fine in electron fiddle with forge. This is overall a very puzzling bug.