Wikipedia talk:User scripts/Guide: Difference between revisions

Content deleted Content added
User settings: Replying to Isaacl (using reply-link)
Line 58:
Regarding [//en.wikipedia.org/w/index.php?title=Wikipedia:User_scripts/Guide&diff=1005948259&oldid=1003059041 this edit]: I don't think it's a good idea to recommend setting any arbitrary property for the window object, as it is part of the Document Object Model and so there can be clashes with existing properties or ones introduced in future. [[User:Isaacl|isaacl]] ([[User talk:Isaacl|talk]]) 07:00, 10 February 2021 (UTC)
:{{u|Isaacl}}, thanks for the feedback. I added that because I got stuck when trying to just declare the variable, so I looked at how other user scripts did it. [[WP:REPLYLINK]] and some others use window variables. However, if there is a better way of doing it that accomplishes the same thing, I am certainly open to suggestions. –[[User:Novem Linguae|<span style="color:limegreen">'''Novem Linguae'''</span>]] <small>([[User talk:Novem Linguae|talk]])</small> 08:04, 10 February 2021 (UTC)
::In general, if you're going to declare a global, it should be named something that would never be used by anything else. Which is usually done by prefixing it with the name of the script. [[User:Nardog|Nardog]] ([[User talk:Nardog|talk]]) 08:16, 10 February 2021 (UTC)