webgui icon indicating copy to clipboard operation
webgui copied to clipboard

Use of the `document.write()` method is strongly discouraged

Open zackspear opened this issue 2 years ago • 0 comments

Saw this while testing something: Screen Shot 2022-10-20 at 16 06 40

Chrome has been warning about this since 2016. https://developer.chrome.com/blog/removing-document-write/

Shouldn't take too much to refactor an alternative way of showing errors on the page.

More details:

  • https://developer.mozilla.org/en-US/docs/Web/API/Document/write
  • https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#document.write()

webgui usage of document.write()

  • https://github.com/limetech/webgui/blob/4b1e418a1b3a2e739e23bc7aedb704c66cf7a079/plugins/dynamix/include/.set-password.php#L349
  • https://github.com/limetech/webgui/blob/4b1e418a1b3a2e739e23bc7aedb704c66cf7a079/plugins/dynamix/include/.login.php#L532
  • https://github.com/limetech/webgui/blob/d7982ce3e072d5c86d5f4ce79e5da29e5f7838db/plugins/dynamix.vm.manager/novnc/app/error-handler.js#L58

zackspear avatar Oct 20 '22 23:10 zackspear