Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to reference (a single) resource file outside the PCI bundle (non-CDN) #391

Open
quark-s opened this issue Dec 20, 2023 · 0 comments

Comments

@quark-s
Copy link

quark-s commented Dec 20, 2023

Dear team,

I'm aware that the current implementation of the (TAO Advance) test-runner requires the PCI to provide a single, bundled JS file as an entrypoint.

A PCI we created earlier depends on content, which is provided by a third-party runtime which is rendered via <iframe> while communicating with the host pci via PostMessage. In the previous test runner engine, this was possible due to the fact that a PCI could bring it's own resources and reference them by using the TAO AssetManager.

Unfortunately, the third-party runtime depends on certain internal files & directories to be present and therefore cannot be bundled into the PCI directly. As a workaround for the current system, we were considering to prepare a ServiceWorker (SW) which includes these external resources to make them available to the PCI via relative URLs.
This SW would run in it's own scope and would be disposed of with the "onCompleted" event.

Problem is:
the nature of how SWs are created requires an URL to a js-file containing the SW-code.
Providing a "blob:" or "data:" URL to the navigator.serviceWorker.register() function is restricted by W3C due to security concerns.

To cut a long story short:
Is there a workaround or configuration in the imsPciCreator.json, to include and reference a single additional sourcefile?

Thanks & kind regards,
Felix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant