-
Notifications
You must be signed in to change notification settings - Fork 744
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
[Bug]: Registers an unload listener #5913
Comments
I am not sure if this is a DNN issue or not. If jQuery just does it, it is out of our purfiew. JQuery is not required in DNN for visitors, only for the edit experience (with the exception of popups being enabled and the Search skinobject). We can't really troubleshoot from a production site with using the client resource management. The current out-of-the-box theme does provide jQuery but the new theme in DNN10 will not. At any rate, your theme is not the out-of-box one so it is a moot point. But for now this is not really actionable unless there is reasons the believe this is DNN specific. For what its worth this error/warning is also present if you inspect github right here :) If you have more details to make this issue actionable, please add info and I'll be happy to reopen. |
hello valadas i thinks this is not the issue for jquery or ajax. this is the problem that dnn used unload listeners on backend i think! |
but this is the big problem that dnn websites are now have low rate of lighthouse because of this problem |
From what I can see, it looks like a Microsoft.ajas issue and you already opened an issue there too MicrosoftDocs/feedback#3975 |
Searching the codebase here, I found this:
|
The unload handler is being set here:
|
It appears to be a MicrosoftAjax issue, but no idea where an appropriate place would be to open an issue with them. |
Well, the link above is in DNN, I don't know off-the-cuff if it is the only instance, but it would be a start... I am not sure the error is on Microsoft side now with searching here... |
as i see this is to replace the unload with beforeunload function but i dont know what will happen if we do that on dnn backend and whats the usage of this function ! |
That could be something to try out and just see what happens; modify this line to say I would recommend trying |
Another thing to try is just delete the line entirely and see what happens. It already doesn't fire reliably, and it will be gone for good eventually, so it would be good to see what happens if it just wasn't there at all. |
i changed the MicrosoftAjax.js file yesterday but the scriptresource.axd file didnt changed! |
scriptresource.axd is a handler that can serve multiple scripts potentially merged together and/or minified, it is not a file exactly. What needs to be done is to see what is using onload, figure out the effects of changing it, etc. |
Also, I spotted by a search one usage, but there could be more to it... |
great @GaurangMistry |
I don't think this is the proper fix. not using the offending method would be a better fix. The code is compiled into an assembly. There could be some workaround but the proper fix is to find the correct source of the bug. |
I checked the @GaurangMistry website and now there is no error for unload listener on his website! |
@valadas , this error on google lighthouse is not bug! it is about the standards that to be better on google websites need that. We should not use unload listener in our codes |
I agree, my point is that preventing the ajax library from loading is more of a workaround than a proper fix. I may have ramifications and the proper fix would be to fix the underlying code to not use unload. |
your right mr valadas, now what should we do to fix this problem with lighthouse? |
I am not sure without spending the time looking into it. I think in DNN usage of microsoft Ajax potentially. |
Is there an existing issue for this?
What happened?
We have many sites in DNN and we are creating all sites perfectly with Google LightHouse. In Google LightHouse, we are facing one issue common in all sites is "Registers an unload listener". This is coming from Default Jquery file which DNN used.
I searched in google and got many suggestions to delete "Unload" from addEventListener method from Jquery or use "visibilitychange" but it's not work. We also take help of Jquery experts but not get expected result. So, we wish if you have any idea about it and you can directly work with us on project to fix this issue.
Steps to reproduce?
Current Behavior
Expected Behavior
Need to fix "Registers an unload listener" error and get 100% score in Google Lighthouse
Relevant log output
Anything else?
No response
Affected Versions
9.13.0 (latest release)
What browsers are you seeing the problem on?
Firefox, Chrome, Safari, Microsoft Edge
Code of Conduct
The text was updated successfully, but these errors were encountered: