-
Notifications
You must be signed in to change notification settings - Fork 11
Support Proposes Best Practise for Indicating that Content of SPA is Ready #4
Comments
Sounds like a good initiative. I've renamed the event I'm using from PrerenderReady to XContentReady in commit ce28922 |
Great, thanks. I've advertised a bit at other projects like this one [1 - 2], let's see if we get some momentum. |
Cool. I saw the comment from Todd about prerender and the issue with combining request counting with event listening. Perhaps he can add a configuration option that specifies whether to rely on events or request counting. I noticed that PhantomJS doesn't support CustomEvent so I'm using the old document.createEvent method instead. |
I've commented on it and proposed a solution. Interesting catch regarding Phantom as I'm just trying to get a PoC working. Where did you learn about the fact that Phantom does not support it? |
When I tried instantiating CustomEvent, Phantom complained about it not existing. It worked in my browser but it seems strange that Phantom wouldn't support it. I'll try to investigate further over the weekend. |
So far in my experiments, I'm not able to catch the event at all. I tried these both variants to throw it:
And I can catch non-custom DOM events. |
@vanthome I've created an example at https://gist.github.com/Stanback/11068255 (it works for me using PhantomJS 1.9.7). I'm attaching an event listener to the active page, which notifies Phantom via window.callPhantom(). If I use CustomEvent, Phantom returns the following error:
|
Thx! I came up with more or less the same solution using window.callPhantom() but I think I had some issue so that the event was not fired -- working now. I have updated the spec with a hint that the custom event cannot be used as of Phantom 1.9.7. |
Cool - the hint looks good. |
The XContentReady Event might be worth to support. What do you think?
The text was updated successfully, but these errors were encountered: