Same origin policy

Earlier, I said a couple of times that shared workers will be available only to those parent files which share the same origin. What does that mean?

Let us consider the URL http://www.packtpub.com/all.

Here's a table demonstrating which URLs will be of the same origin with this domain, and which won't be:

New URL Same Origin Reason
http://www.packtpub.com/support Yes -
http://www.packtpub.com/account/abc/xyz Yes -
https://www.packtpub.com/all No Different protocol
http://username:password@www.packtpub.com/all Yes -
http://www.packtpub.com:8000/somepage No Different port number
http://packtpub.com/somepage No Different host
http://dev.packtpub.com/somepage No

Different host

 

By now, I believe that ...

Get Learn ECMAScript - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.