3 ms·
So the protection was trapping the sinister script context running in my browser in an infinite loop. Clever! …Does that grind my browser to a halt? Why not j
by Waterluvian 4y ago
So the protection was trapping the sinister script context running in my browser in an infinite loop. Clever!
…Does that grind my browser to a halt?
Why not just throw an error or something?
- human 4y agoIf you’re visiting a webpage with such a script, it may be for your own good to freeze it.
- yuliyp 4y agoIt'll grind the context it's running in to a halt. The point is that nobody wants their site to be broken, so they won't request that with a <script> tag.
- Waterluvian 4y agoOh I see. That makes sense.
- alpaca128 4y ago> The point is that nobody wants their site to be broken Nobody wants it but unless it's completely broken most don't care enough to do something about it. Which is why this JSON trick is done in the first place. Given this is about Google: YouTube has the same bug in its comment text fields for at least 5 years, in rare cases submitting a comment only results in the error "n is undefined", it can't handle the browser's back button, sometimes links don't work until I scroll the site a bit, the new "preview video on hover" feature doesn't reliably react to mouse events and its animation swallows mouse clicks, and that's just the few things I remember off the top of my head.
- mgsouth 4y agoI imagine for fear that Evil Script would trap the error. An infinite loop precludes any transfer of control. Theoretically.
- jraph 4y agoYes, I think you could catch the error with window.onerror or script.onerror and in this handler, get the content with script.textContent or script.innerHTML. (where script is the javascript variable that corresponds to the javascript script tag, possibly initialized with script = document.createElement('script'))