What's the point of the Anti-Cross-Domain policy?

前端 未结 4 502
隐瞒了意图╮
隐瞒了意图╮ 2021-01-12 10:42

Why did the creators of the HTML DOM and/or Javascript decide to disallow cross-domain requests?

I can see some very small security benefits of disallowing it but in

4条回答
  •  庸人自扰
    2021-01-12 11:30

    When cross-domain scripting is allowed (or hacked by a clever Javascripter), a webpage can access data from another webpage. Example: joeblow.com could access your Gmail while you have mail.google.com open. joeblow.com could read your email, spam your contacts, spoof mail from you, delete your mail, or any number of bad things.

提交回复
热议问题