-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Defer attribute #2
Comments
As far as I know (https://www.w3schools.com/tags/att_script_defer.asp) the defer attribute has to be used only for external scripts but:
am I missing something? |
Sorry, I didn't know the attribute has to be used only for external scripts. I have seen a couple of 'optimization' plugins which are setting the defer attribute, even though those scripts are internal scripts. And I think you are right about the fact that there may be situations where some inline scripts run before the dependencies are loaded. Could it be possible create an option in the module to opt-in include the defer attribute? |
I don't know, it seems to me that maybe we can cause more problems, would we add an option to "defer every script"? or should it be done for every single script (which is almost impossible to do)? |
Just tested this module for Magento 2.2.4 and it seems to be working. The Javascript is placed before the closing body tag.
But I expected to have the script tags containg the
defer="defer"
attribute. Is there a reason for this and is it possible to add the attribute?Thank you in advance!
The text was updated successfully, but these errors were encountered: