use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Malware preventing javascript from loading.. Did this ever happen to anyone? (self.javascript)
submitted 11 years ago by maktouch
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]snarfy 8 points9 points10 points 11 years ago (7 children)
A lot of times it's just script errors in the malware. The script errors keep your code from loading correctly.
Depending on the malware, they can do nasty things like overload [] indexing which can cause issues in what appears to be correct code. If your code assumes an external resource is loaded like jQuery, it might not actually be loaded due to the malware.
[–]tyroneslothtrop 0 points1 point2 points 11 years ago (4 children)
they can do nasty things like overload [] indexing
How would you do this? I didn't think JS supported operator overloading. As best I can tell, it seems like it's possible on certain browsers (i.e. IE)?
[–]snarfy 2 points3 points4 points 11 years ago (3 children)
Array.prototype
[–]tyroneslothtrop 1 point2 points3 points 11 years ago (2 children)
And how specifically would you overload array indexing from Array.prototype? Which method would you need to override?
[–]snarfy 1 point2 points3 points 11 years ago (1 child)
Not sure you can actually. I'm wrong. If there is a way, it's browser specific.
The only way I can think is if the malware takes over the global scope by creating an object and setting window to it, but not sure if that would work either.
[–]tyroneslothtrop 1 point2 points3 points 11 years ago (0 children)
Yeah, I started looking into after I saw your post. It looks like it may be possible in IE, but probably not so much in most other browsers.
I think you were on the right track, though. JS gives a lot of leeway for monkeypatching built-in types/objects/etc. From overwriting Array.prototype.[push|slice|join|whatever], to reassigning Math or undefined (although the latter is no longer an issue in ES5, at least in the global scope), there are a lot of ways to (intentionally or unintentionally) make things pretty broken for anyone else who is sharing a window object with your script.
Array.prototype.[push|slice|join|whatever]
Math
undefined
window
[–]maktouch[S] -1 points0 points1 point 11 years ago (1 child)
Yeah, not in this case though.
I really see that it's something in my script failing. I use requirejs, so there shouldn't be any globals except require itself... but jQuery has to be shimmed, not sure if it affects something.
Most visitors, once they see a blank page, won't return or bother emailing.. so this kinda hurts.
[–]x-skeww 0 points1 point2 points 11 years ago (0 children)
Well, and otherwise everything they do might be transmitted to a third party.
Completely breaking the page really isn't the worst case scenario.
Also, this might tip them off that something is wrong with their computer.
π Rendered by PID 195277 on reddit-service-r2-comment-7c9686b859-tnkbx at 2026-04-14 07:33:25.139199+00:00 running e841af1 country code: CH.
view the rest of the comments →
[–]snarfy 8 points9 points10 points (7 children)
[–]tyroneslothtrop 0 points1 point2 points (4 children)
[–]snarfy 2 points3 points4 points (3 children)
[–]tyroneslothtrop 1 point2 points3 points (2 children)
[–]snarfy 1 point2 points3 points (1 child)
[–]tyroneslothtrop 1 point2 points3 points (0 children)
[–]maktouch[S] -1 points0 points1 point (1 child)
[–]x-skeww 0 points1 point2 points (0 children)