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 | SameOrigin | Reason |
Yes | - | |
| Yes | - |
No | Different protocol | |
Yes | - | |
| No | Different port number |
| No | Different host |
| No | Different host |
Â
By now, I believe that you will be able to guess what makes something the same origin and what does not. Yes, you're right! The same host, port, and protocol make two URLs under the same origin. For listed URLs which have their answers as yes, only those URLs will be able to access the shared worker spun by http://www.packtpub...