From f9b48983a82f2c88ef288be26012781149a880da Mon Sep 17 00:00:00 2001 From: Olha Brozhenets Date: Mon, 14 Feb 2022 15:37:50 +0200 Subject: [PATCH 01/26] adds cross window communication --- .../03-cross-window-communication/article.md | 268 +++++++++--------- .../postmessage.view/iframe.html | 4 +- .../postmessage.view/index.html | 4 +- .../sandbox.view/index.html | 2 +- .../sandbox.view/sandboxed.html | 4 +- 5 files changed, 141 insertions(+), 141 deletions(-) diff --git a/3-frames-and-windows/03-cross-window-communication/article.md b/3-frames-and-windows/03-cross-window-communication/article.md index 091a0cecb..d2475689d 100644 --- a/3-frames-and-windows/03-cross-window-communication/article.md +++ b/3-frames-and-windows/03-cross-window-communication/article.md @@ -1,130 +1,130 @@ -# Cross-window communication +# Міжвіконна комунікація -The "Same Origin" (same site) policy limits access of windows and frames to each other. +Політика "Одного походження" (одний і той самий сайт) обмежує доступ вікон і фреймів один до одного. -The idea is that if a user has two pages open: one from `john-smith.com`, and another one is `gmail.com`, then they wouldn't want a script from `john-smith.com` to read our mail from `gmail.com`. So, the purpose of the "Same Origin" policy is to protect users from information theft. +Ідея полягає в тому, що якщо користувач має дві відкриті сторінки: одну з `john-smith.com`, а іншу -- `gmail.com`, тоді він не хоче, щоб сценарій з `john-smith.com` читав нашу пошту з `gmail.com`. Отже, мета політики "Одного походження" -- захистити користувачів від крадіжки інформації. -## Same Origin [#same-origin] +## Політика "Одного походження" [#same-origin] -Two URLs are said to have the "same origin" if they have the same protocol, domain and port. +Кажуть, що дві URL-адреси мають "одне походження", якщо вони мають однаковий протокол, домен і порт. -These URLs all share the same origin: +Усі ці URL-адреси мають одне походження: - `http://site.com` - `http://site.com/` - `http://site.com/my/page.html` -These ones do not: +А ці ні: -- http://www.site.com (another domain: `www.` matters) -- http://site.org (another domain: `.org` matters) -- https://site.com (another protocol: `https`) -- http://site.com:8080 (another port: `8080`) +- http://www.site.com (інший домен: `www.` має значення) +- http://site.org (інший домен: `.org` має значення) +- https://site.com (інший протокол: `https`) +- http://site.com:8080 (інший порт: `8080`) -The "Same Origin" policy states that: +У політиці "Одного походження" зазначено, що: -- if we have a reference to another window, e.g. a popup created by `window.open` or a window inside `