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

Document-relative m-frame and content addressing #72

Closed
MarcusLongmuir opened this issue Jul 16, 2023 · 0 comments · Fixed by #73
Closed

Document-relative m-frame and content addressing #72

MarcusLongmuir opened this issue Jul 16, 2023 · 0 comments · Fixed by #73
Assignees
Labels
enhancement New feature or request

Comments

@MarcusLongmuir
Copy link
Collaborator

What is your suggestion?

Currently src attributes are interpreted as being relative to the page that the MML content has been loaded into. (e.g. an m-image with src="/foo.png" loaded on page localhost:8080 would result in requesting http://localhost:8080/foo.png)

If the m-image was an element of a remote document (e.g. an m-frame loaded from ws://example.com/) then src="/foo.png" should instead resolve to http://example.com/foo.png.

Why is it important?

This allows documents to refer to relative assets without having to determine their own address, which can be complex.

The behaviour of using the location of the document hosting the element requesting content is the same as iframe in HTML where the elements within the iframe with relative paths are loaded relative to the iframe's location.

How would you implement it?

Each remote document context has an address. This address can be used to determine the absolute path from potentially relative paths of content.

Packages

mml-web

Extra details

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🚢 Released
Development

Successfully merging a pull request may close this issue.

1 participant