Answer
An origin = scheme + host + port (https://app.example.com:443).
Same-Origin Policy (SOP) limits how documents/scripts from one origin interact with resources from another:
| Action | Cross-origin? |
|---|---|
Embed <img src> | Allowed (no JS read of pixels without CORS) |
<script src> | Allowed (runs in page context — supply-chain risk) |
fetch() + read body | Blocked unless CORS allows |
Access iframe.contentWindow | Blocked unless same origin |
localStorage | Origin-scoped, isolated |
Escape hatches: CORS, postMessage with origin checks, JSONP (legacy), WebSockets (different model — server validates Origin header).