-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Event Completion Trigger always times out #137
Comments
Womp! The trigger was firing before the page was fully loaded. This html works as expected. <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
<h1 id="title">Event completion trigger test</h1>
<script type="text/javascript">
setTimeout(function() {
let title = document.getElementById("title");
title.dispatchEvent(new CustomEvent("pdfRenderReady", {}));
}, 500)
</script>
</body>
</html> |
Un-womp. It seems that event completion triggers only works after some arbitrary point in time, I assume after the page navigation has completed. If the JS has completed before that, then the event is never received. I tried firing my event after the My use case is that I have browser-side JavaScript which sometimes takes a long time to evaluate, and at other times is really quick, depending on the data being rendered. I was hoping to use a single event to indicate that the load is complete. |
I'll look into attaching an event listener before the page load. Thanks for the info! |
FWIW, it may just make more sense to eliminate events as a completion trigger and encourage variable or element triggers. |
I also found this problem. How do I deal with it? |
I'm having trouble getting completion triggers working. What I think was working with a previous release is no longer working for me.
html-pdf-chrome version: 0.5.0
This results in:
What is my malfunction?
The text was updated successfully, but these errors were encountered: