What is this facebook code?

Checking what facebook does in my navigator, I see this code:

for (;;);{"t":"refresh"}

If you try to evaluate it, you can understand what is happening (endless loop).

Do you know what it is?

+3
source share
1 answer

Is it correct if this was in response from an ajax call?

This is one of the strategies used to avoid XSS when dynamically adding scripts containing user-specific content.
If it weren’t, the [evil] page could request this script inside a regular script tag and have access to the methods and objects defined by it.

, script Facebook xhr, , , . {"t":"refresh"}.

A script .

+5

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


All Articles