Closed DeleteThisAcount closed 7 years ago
Using let
on the global scope doesn't make sense - it has no difference to var
there so you might as well just do that and then not worry about compatibility.
Also, why did you make STYLE
uppercase?
I (author of userscript) made "STYLE" uppercase because it's a tag name, and while in this particular context it makes no difference, tags are spelt in uppercase in JavaScript (see Node.tagName
), and I want my code to be consistent (even though here it doesn't matter).
As for "let" vs "var" -- I don't know. If we want compatibility, too late. We use "let" almost everywhere, possibly my fault, I've read that "var" tends to have some quirks, so I just generally avoid it. We only support Chrome and Firefox, most people auto update, so it should be fine either way. However, we could change it if you wish.
so will this happen?
no. i have asked already before, and they have decided not to do it.
for the message page // ==UserScript== // @name Highlight New Notifications // @version 0.1 // @description Highlights new notifications in the updated /messages page on Scratch // @author jokebookservice1 // @match https://scratch.mit.edu/messages/ // ==/UserScript== let css = document.createElement("STYLE");css.appendChild(document.createTextNode(".mod-unread{background-color: #b8eafc;}"));document.body.appendChild(css);