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

Change F2 script loading to be relative to manifest url, not html page url #73

Open
ilinkuo opened this issue Apr 15, 2013 · 1 comment

Comments

@ilinkuo
Copy link

ilinkuo commented Apr 15, 2013

Not urgent.

Currently, F2's script loading simply writes the manifest's scripts array into script tags in the html page without alteration. When relative urls are specified in the manifest, they are resolved relative to the target page. This is incorrect because the app provider controls the manifest and scripts whereas the container provider controls the target page. If the same manifest is to be used across different organizations/containers, the urls must be resolved relative to something the app provider controls , not something the container provider controls -- though a lot of current F2 implementations work because the app provider == container provider.

This can be resolved by publishing only full urls in the manifest, but this is not the preferred solution. The better solution is for the F2 loader to add logic to resolve relative urls relative to the manifest. The best solution would be to switch the underlying loader to AMD, as AMD's loader has this kind of logic.

This may cause some backward compatibility problems with existing implementations, but these are easily correctible.

@timburcham
Copy link
Contributor

As this has been referenced in #270 , wondering if there's a solution to this issue that doesn't involve moving to AMD. @ilinkuo 's ideas on resolving relative urls relative to the manifest get part of the way there -- however, any requests inside the resulting appclass.js also need awareness of their own domain (for example, a script making an ajax request -- which broadens the original scope of this issue).

Unless someone is aware of something in javascript that allows for this detection, it would seem that the only way to make this additional use case work is to forward the base url on the app manifest request as an explicit parameter.

@brianbaker brianbaker removed this from the 2.0 milestone Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants