ivanslater wrote:i was guessing the widgets may create some problems :) so they are.
I think some hack can help here. We can intercept widget contents before they are rendered and include delay in all script tags. A small plugin can handle it.
So, once admin's views dont require defer scripts, we could try new approach too, using a "cloned" _root view with fixed scripts included, then the number of views we need to check will decrease a lot.
What do you think?
Ivan.
I am not a huge plugin fan but we need to find solution for everyone.If we can do it for google analytics and yandex metrika without interrupting them, why not :)
There are still parts that i didn't understand on eurodress's method. Since he is working on it more than anyone else and tested it, I am sure he has a good solution. I didn't have a chance a try his solution yet. I understood the inline script part.
The only part I didn't understand;
we are changing the generate scripts method in PageHeadBuilder.GenerateScripts. So it is defering all js. how we separate the ones required for loading the libraries?
When I analyse my page with https://developers.google.com/speed/pagespeed/insights/
all google bots are interest in the scripts we call from _Root.Head with Html.AppendScriptParts and Html.AddScriptParts.