Hello there,
I’m trying to create an extension which would show some interactive infographics over the video stream. This infographics would be clickable by viewer, would display some animated panels containing additional information related to the video stream. For better understading, let’s imagine a football video stream where user can interactively show and hide player statistics, match information etc. while other streamer could provide different video stream with different infographics. This infographics would be configurable by the streamer by providing a URL address to the infographics ‘renderer’ in the extension settings. This content URL is limited to a domain which is whitelisted in the extension features settings so the extension would not be able to be abused by inserting any random content.
My question is - is there a way how the extension could load, display and execute content from such a domain? It means html page, css styles, images, json data files, javascript. I have tried to render the content to element with the ‘data’ attribute set to the URL address but this doesn’t seem to work as the extension blocks this content by CSP. Changing default-src, script-src and other related attributes in Content-Security-Policy meta header doesn’t seem to work. I have read the Guidelines and Policies, especially paragraph 2.8 saying that all files used by the extension must be included in the zip file for your assets. And here is the problem - I do not know which files will be used by the extension because it is the streamer who will say which content will be displayed.
I have also tried to load the content in the extension with the fetch() function and set the response as .innerHTML, which worked, but this would not load any additional content required by the infographics page, like javascripts, images etc.
Does this have a solution? Can I, for example, use my custom configuration service API to store the infographics content and then load it from configuration on viewers side during runtime? Or is there a way how to setup CSP to allow the extension to load and run my external content?
Thanks for any advices.