Closed henningn closed 1 year ago
This is indeed a bug... The problem was or is, that for execution of embedded scripts and styles... the content must be appended to the header and then removed (not sure whether this also applies to css, I need to test that) The code does this and the result is there, but I did not take into consideration that some code might rely on those dynamic script and style tags to be present in the page. I will fix that (or check the changes and apply them properly)
Thanks for the tests and for the bug report!
Additional info, I ran a quick test... style elements can stay in place, no need for the head appendix method, but the elements must be generated via document.createElement innerHTML does not suffice in this case... So we can use innerHTML to get the elements in, but they wont be evaled... for a proper evaluation we still must use document.createElement and then append the element! A strategy probably would be to walk over the replaced style elements after innerHTML and then replace the existing ones with newly created ones with the same content and remove the old ones!
Thanks test is failing as expected... will start to work an a proper fix for this issue
the solution even simplifies the code, which is welcome, I will issue a new version soon!
I need to check another issue <script type="module" atm not is evaluated by the ajax part as it seems)
The style tag must be within the sheet and NOT in the
element of the page.Expected HTML after ajax:
But it is: