ScratchTools icon indicating copy to clipboard operation
ScratchTools copied to clipboard

innerHTML is used in places where DOMParser should be used

Open GarboMuffin opened this issue 2 years ago • 1 comments

Consider these functions:

https://github.com/STForScratch/ScratchTools/blob/471e718369e9588ea84b288006ab82f1553dd8b3/features/follower-count.js#L11-L12

https://github.com/STForScratch/ScratchTools/blob/471e718369e9588ea84b288006ab82f1553dd8b3/features/hover-user-cards.js#L34-L35

https://github.com/STForScratch/ScratchTools/blob/471e718369e9588ea84b288006ab82f1553dd8b3/features/load-more-forum-posts.js#L35-L36

It is my belief that these functions should use the DOMParser API instead of actual DOM elements

GarboMuffin avatar Jan 22 '23 08:01 GarboMuffin

This project has a general issue of using innerHTML in way too many places unnecessarily. This issue is just the tip of the iceberg in that regard.

GarboMuffin avatar Jan 22 '23 08:01 GarboMuffin