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

Support dynamically loaded images #73

Closed
cburgmer opened this issue Aug 22, 2014 · 5 comments
Closed

Support dynamically loaded images #73

cburgmer opened this issue Aug 22, 2014 · 5 comments
Milestone

Comments

@cburgmer
Copy link
Owner

Images loaded in JS with relative paths with different basePath to host document will fail. This is due to the page content being extracted and executed in an iframe without the document's base url.

cburgmer added a commit that referenced this issue Oct 18, 2014
cburgmer added a commit that referenced this issue Oct 18, 2014
@cburgmer
Copy link
Owner Author

Currently JavaScript is executed after the static document is inlined. I.E. dynamic images are loaded too late in the process for the inlining to happen.

Todo:

  • Install Image proxy into document.createElement('img') too
  • Rename xhrProxies to just proxies
  • Simplify executeJs()

@cburgmer
Copy link
Owner Author

cburgmer commented Nov 8, 2014

Not sure whether there's a quick solution. However the code should be cleaned up for 1.0 as far as possible.

@cburgmer cburgmer added this to the 1.0 milestone Nov 8, 2014
@cburgmer
Copy link
Owner Author

Not going to be supported for now

@cburgmer
Copy link
Owner Author

The parent's base URL is only fitting if the page you are trying to render is the same URL. I feel the real problem is that currently the inlining of resources happens before the JS is run, rather than the other way around.

The choice to run the JS in an iframe outside of the base URL context was made because otherwise the iframe onload event would not trigger if the URL was not from the same origin, and rasterizehtml would never receive a callback, waiting for ever. There might also have been other reasons involved, but I currently cannot reproduce.

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

2 participants