What does (1) do in Gmail

Possible duplicate:
Why is there a "while (1);" in the answer of XmlHttpRequest?

If you look at the XHR POST requests that Gmail makes on the server when it updates the list of your email, you will see that each response starts with:

while(1); [[["v","CKbPYpt__Vc.en.","8","d7634f09ff9e61c8"] ,["di",342] ,["ub",[["^i",1296218266987] ,["^f",1296218266987] (...) 

Why does Google run every answer with an infinite loop?

I read that this is a security trick http://my.opera.com/hallvors/blog/show.dml/260127 , but I'm not sure how it should be a good security measure.

+2
source share
1 answer

Guess ... So any malicious attempt to eval response or point a <script> on a resource, and not on its proper parsing, will fail.

+2
source

Source: https://habr.com/ru/post/1385410/


All Articles