Same-origin policy limits which pages can read each other

The rule that stops a page on one site reading data from another is the foundation the whole web security model rests on.

Without it, any page you visited could read your webmail in another tab. Almost every browser security feature is either an implementation of this or a carefully controlled exception to it, and most browser vulnerabilities are ways of escaping it.

More on Browser security