This commit is contained in:
Ilya Kantor 2019-05-06 15:18:32 +02:00
parent 702362f616
commit ed86221c7f
3 changed files with 3 additions and 3 deletions

View file

@ -70,7 +70,7 @@ Examples of such restrictions include:
There are ways to interact with camera/microphone and other devices, but they require a user's explicit permission. So a JavaScript-enabled page may not sneakily enable a web-camera, observe the surroundings and send the information to the [NSA](https://en.wikipedia.org/wiki/National_Security_Agency).
- Different tabs/windows generally do not know about each other. Sometimes they do, for example when one window uses JavaScript to open the other one. But even in this case, JavaScript from one page may not access the other if they come from different sites (from a different domain, protocol or port).
This is called the "Same Origin Policy". To work around that, *both pages* must contain a special JavaScript code that handles data exchange.
This is called the "Same Origin Policy". To work around that, *both pages* must agree for data exchange and contain a special JavaScript code that handles it. We'll cover that in the tutorial.
This limitation is, again, for the user's safety. A page from `http://anysite.com` which a user has opened must not be able to access another browser tab with the URL `http://gmail.com` and steal information from there.
- JavaScript can easily communicate over the net to the server where the current page came from. But its ability to receive data from other sites/domains is crippled. Though possible, it requires explicit agreement (expressed in HTTP headers) from the remote side. Once again, that's a safety limitation.

View file

@ -161,7 +161,7 @@ Comparisons
Other comparisons convert to a number as well.
The strict equality operator `===` doesn't do the conversion: different types always mean different values for it, so:
The strict equality operator `===` doesn't do the conversion: different types always mean different values for it.
Values `null` and `undefined` are special: they equal `==` each other and don't equal anything else.

View file

@ -12,7 +12,7 @@ Promise.all(
Here we have an array of `fetch(...)` promises that goes to `Promise.all`.
We can't change the way `Promise.all` works: if it detects an error, then it rejects with it. So we need to prevent any error from occurring. Instead, if a `fetch` error happens, we need to treat it as a "normal" result.
We can't change the way `Promise.all` works: if any promise rejects with an error, then `Promise.all` as a whole rejects with it. So we need to prevent any error from occurring. Instead, if a `fetch` error happens, we need to treat it as a "normal" result.
Here's how: