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
disableJavaScriptFileLoading and script events #849
Comments
Hi @dteoh! 🙂 This is a tough one. I guess the most logical thing here would be to trigger an I'm not sure custom testing logic like this should be handled by Happy DOM, but I also understand that this is something that isn't very easy to implement a polyfill for as it would have to override internal logic. |
Thank you for your feedback! Yes, I think firing an |
…g to fetch a CSS file or Javascript file when it has been disabled using "window.happyDOM.settings.*".
…leloading-and-script-events #849@minor: Adds support for triggering an error event when attemptin…
…"|" as operators for finding attributes containing a word did not match when there was only one word.
@dteoh I have implemented a fix now that will trigger an error 🙂 You can read more about the release here: |
Thank you very much! |
Is your feature request related to a problem? Please describe.
Is it possible to get
script.onload
andscript.onerror
events to fire whendisableJavaScriptFileLoading
is used?I have some code like:
When
disableJavaScriptFileLoading
is used, the promise won't resolve since theload
event doesn't get fired.Describe the solution you'd like
Could we extend the option to be:
disableJavaScriptFileLoading: true | false | 'load' | 'error' | callback
?load
: don't load the file, but fire theload
eventerror
: don't load the file, but fire theerror
eventtrue | false | 'load' | 'error'
to customize the behaviourWDYT?
The text was updated successfully, but these errors were encountered: