Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The clickjacking attack, SSE, CSS-animations#343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
dolgachio merged 71 commits intojavascript-tutorial:masterfromastropsy999:master
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
71 commits
Select commitHold shift + click to select a range
e3ffff5
Update article.md
astropsy999May 24, 2022
ceb3946
Update article.md
astropsy999May 24, 2022
f6aafd1
Update article.md
astropsy999May 25, 2022
0f3f2a9
Update article.md
astropsy999May 25, 2022
ba4c2b9
Update article.md
astropsy999May 25, 2022
9a855d9
Update article.md
astropsy999May 26, 2022
ca0b538
Update article.md
astropsy999May 26, 2022
52e5ab9
Update article.md
astropsy999May 26, 2022
7d621a6
Update article.md
astropsy999May 26, 2022
b310810
Update index.html
astropsy999May 26, 2022
46d37a3
Update article.md
astropsy999Jun 4, 2022
d5d59f6
Update article.md
astropsy999Jun 4, 2022
3fe04de
Update article.md
astropsy999Jun 5, 2022
d161dd1
Update index.html
astropsy999Jun 5, 2022
52bf3af
Update article.md
astropsy999Jun 5, 2022
8f3e3fe
Update article.md
astropsy999Jun 6, 2022
ac9996b
Update article.md
astropsy999Jun 6, 2022
3bd140e
Update article.md
astropsy999Jun 7, 2022
18a38a3
Update iframe.html
astropsy999Jun 7, 2022
75d1f7c
Update index.html
astropsy999Jun 7, 2022
d9660ab
Update iframe.html
astropsy999Jun 7, 2022
fb08989
Update facebook.html
astropsy999Jun 7, 2022
0ef68a9
Update index.html
astropsy999Jun 7, 2022
6e53413
Update facebook.html
astropsy999Jun 7, 2022
c80ed0f
Update index.html
astropsy999Jun 7, 2022
469e2d3
Update article.md
astropsy999Jun 8, 2022
f84fa7d
Merge branch 'master' into master
astropsy999Jun 8, 2022
d4c6a64
Update article.md
astropsy999Jun 8, 2022
935199a
Update article.md
astropsy999Jun 9, 2022
5f35c46
Update article.md
astropsy999Jun 10, 2022
999ab9d
Update task.md
astropsy999Jun 12, 2022
fafe785
Update task.md
astropsy999Jun 12, 2022
76007bc
Update index.html
astropsy999Jun 12, 2022
84362d4
Update index.html
astropsy999Jun 12, 2022
22fdad6
Update index.html
astropsy999Jun 12, 2022
d051d1e
Update index.html
astropsy999Jun 12, 2022
f0f4d93
Update index.html
astropsy999Jun 12, 2022
58e0228
Update index.html
astropsy999Jun 12, 2022
d3cdbac
Update index.html
astropsy999Jun 12, 2022
410a0e1
Update index.html
astropsy999Jun 12, 2022
18f9da2
Update 3-frames-and-windows/06-clickjacking/article.md
astropsy999Jul 3, 2022
a6806c0
Update 3-frames-and-windows/06-clickjacking/article.md
astropsy999Jul 3, 2022
82cd9d5
Update 3-frames-and-windows/06-clickjacking/article.md
astropsy999Jul 3, 2022
6b1b439
Update 3-frames-and-windows/06-clickjacking/article.md
astropsy999Jul 3, 2022
64ccba1
Update 3-frames-and-windows/06-clickjacking/article.md
astropsy999Jul 3, 2022
e2a2219
Update 3-frames-and-windows/06-clickjacking/article.md
astropsy999Jul 3, 2022
ab9ef8d
Update 3-frames-and-windows/06-clickjacking/article.md
astropsy999Jul 3, 2022
af25da9
Update 3-frames-and-windows/06-clickjacking/clickjacking-visible.view…
astropsy999Jul 3, 2022
3a10141
Update 3-frames-and-windows/06-clickjacking/clickjacking-visible.view…
astropsy999Jul 3, 2022
08ed6b1
Update 3-frames-and-windows/06-clickjacking/clickjacking.view/index.html
astropsy999Jul 3, 2022
74de077
Apply suggestions from code review
dolgachioJul 12, 2022
494b88d
Update 5-network/12-server-sent-events/article.md
astropsy999Jul 21, 2022
f3db6f5
Update 5-network/12-server-sent-events/article.md
astropsy999Jul 21, 2022
afeb15b
Update 5-network/12-server-sent-events/article.md
astropsy999Jul 21, 2022
10e610c
Update 5-network/12-server-sent-events/article.md
astropsy999Jul 21, 2022
5d29d2d
Update 5-network/12-server-sent-events/article.md
astropsy999Jul 21, 2022
118c6cf
Update 7-animation/2-css-animations/article.md
astropsy999Jul 21, 2022
c0b84c4
Update 7-animation/2-css-animations/article.md
astropsy999Jul 21, 2022
ab8be27
Update 7-animation/2-css-animations/article.md
astropsy999Jul 21, 2022
5ae6e12
Update 7-animation/2-css-animations/article.md
astropsy999Jul 21, 2022
d2973b3
Update 7-animation/2-css-animations/article.md
astropsy999Jul 21, 2022
1da1d54
Update 5-network/12-server-sent-events/article.md
astropsy999Jul 28, 2022
2078a03
Update 5-network/12-server-sent-events/article.md
astropsy999Jul 28, 2022
9a56401
Update 5-network/12-server-sent-events/article.md
astropsy999Jul 28, 2022
400fbf6
Update 5-network/12-server-sent-events/article.md
astropsy999Jul 28, 2022
51a327f
Update 6-data-storage/03-indexeddb/article.md
astropsy999Jul 28, 2022
80213a9
Update 6-data-storage/03-indexeddb/article.md
astropsy999Jul 28, 2022
51fc021
Update 6-data-storage/03-indexeddb/article.md
astropsy999Jul 28, 2022
6529a81
Update 6-data-storage/03-indexeddb/article.md
astropsy999Jul 28, 2022
fd843a1
Update 7-animation/2-css-animations/article.md
astropsy999Jul 28, 2022
4e193b5
Apply suggestions from code review
dolgachioAug 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 75 additions & 75 deletions3-frames-and-windows/06-clickjacking/article.md
View file
Open in desktop

Large diffs are not rendered by default.

View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

<body style="margin:10px;padding:10px">

<input type="button" onclick="alert('Like pressed on facebook.html!')" value="I LIKE IT !">
<input type="button" onclick="alert('Лайк натиснуто на facebook.html!')" value="I LIKE IT !">

</body>

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,14 +19,14 @@
}
</style>

<div>Click to get rich now:</div>
<div>Натисніть, щоб розбагатіти:</div>

<!--The url from the victim site -->
<!--URL-адреса з сайту-жертви -->
<iframe src="facebook.html"></iframe>

<button>Click here!</button>
<button>Натисніть тут!</button>

<div>...And you're cool (I'm a cool hacker actually)!</div>
<div>...І ти крутий (насправді я крутий хакер)!</div>

</body>
</html>
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

<body style="margin:10px;padding:10px">

<input type="button" onclick="alert('Like pressed on facebook.html!')" value="I LIKE IT !">
<input type="button" onclick="alert('Лайк натиснуто на facebook.html!')" value="I LIKE IT !">

</body>

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,14 +19,14 @@
}
</style>

<div>Click to get rich now:</div>
<div>Натисніть, щоб розбагатіти:</div>

<!--The url from the victim site -->
<!--URL-адреса з сайту-жертви -->
<iframe src="facebook.html"></iframe>

<button>Click here!</button>
<button>Натисніть тут!</button>

<div>...And you're cool (I'm a cool hacker actually)!</div>
<div>...І ти крутий (насправді я крутий хакер)!</div>

</body>
</html>
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@
<body>

<div id="protector">
<a href="/" target="_blank">Go to the site</a>
<a href="/" target="_blank">Перейти на сайт</a>
</div>

<script>
Expand All@@ -31,11 +31,11 @@

</script>

This text is always visible.
Цей текст завжди видно.

But if the page was open inside a document from another domain, thedivover it would prevent any actions.
Але якщо сторінка була відкрита всередині документа з іншого домену,divнад нею завадить будь-яким діям.

<button onclick="alert(1)">Click wouldn't work in that case</button>
<button onclick="alert(1)">Клік у даному випадку не спрацює</button>

</body>
</html>
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@

<body>

<div>Changes top.locationto javascript.info</div>
<div>Змінює top.locationна javascript.info</div>

<script>
top.location = 'https://javascript.info';
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@

window.onbeforeunload = function() {
window.onbeforeunload = null;
return "Want to leave without learning all the secrets (he-he)?";
return "Хочете піти, не дізнавшись усіх секретів (хе-хе)?";
};

document.body.insertAdjacentHTML('beforeend', '<iframe src="iframe.html">');
Expand All@@ -31,11 +31,11 @@

<body>

<p>After a click on the button the visitor gets a "strange" question about whether they want to leave.</p>
<p>Після натискання на кнопку відвідувач отримує "дивне" запитання про те, чи хоче він піти.</p>

<p>Probably they would respond "No",and the iframeprotection is hacked.</p>
<p>Ймовірно, він відповів би "ні",а захист iframeзламано.</p>

<button onclick="attack()">Add a "protected" iframe</button>
<button onclick="attack()">Додайте "захищений" iframe</button>

</body>
</html>
224 changes: 112 additions & 112 deletions5-network/12-server-sent-events/article.md
View file
Open in desktop

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions5-network/12-server-sent-events/eventsource.view/index.html
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,38 +2,38 @@
<script>
let eventSource;

function start() { //when "Start" button pressed
function start() { //коли кнопку "Пуск" натиснуто
if (!window.EventSource) {
// IEor an old browser
alert("The browser doesn't support EventSource.");
//дляIEчи іншого старого браузера
alert("Браузер не підтримує EventSource.");
return;
}

eventSource = new EventSource('digits');

eventSource.onopen = function(e) {
log("Event: open");
log("Подія: open");
};

eventSource.onerror = function(e) {
log("Event: error");
log("Подія: error");
if (this.readyState == EventSource.CONNECTING) {
log(`Reconnecting (readyState=${this.readyState})...`);
log(`Повторне з’єднання (readyState=${this.readyState})...`);
} else {
log("Error has occured.");
log("Сталася помилка.");
}
};

eventSource.addEventListener('bye', function(e) {
log("Event: bye,data: " + e.data);
log("Подія: bye,дані: " + e.data);
});

eventSource.onmessage = function(e) {
log("Event: message,data: " + e.data);
log("Подія: message,дані: " + e.data);
};
}

function stop() { //when "Stop" button pressed
function stop() { //коли кнопку "Стоп" натиснуто
eventSource.close();
log("eventSource.close()");
}
Expand All@@ -44,7 +44,7 @@
}
</script>

<button onclick="start()">Start</button>Press the "Start" to begin.
<button onclick="start()">Пуск</button>Натісніть "Пуск" для початку.
<div id="logElem" style="margin: 6px 0"></div>

<button onclick="stop()">Stop</button> "Stop" to finish.
<button onclick="stop()">Стоп</button> "Стоп" для зупинки.
7 changes: 4 additions & 3 deletions6-data-storage/03-indexeddb/article.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,6 +35,7 @@ let openRequest = indexedDB.open(name, version);
```

- `name` -- рядок, ім’я бази даних.

- `version` -- версія є цілим числом, типово `1` (пояснення нижче).

У нас може бути багато баз даних з різними іменами, але всі вони існують лише в межах поточного вебсайту (протокол/домен/порт). Різні вебсайти не мають доступу до баз даних один одного.
Expand DownExpand Up@@ -660,9 +661,9 @@ let request = store.openCursor(query, [direction]);

- **`query`** є ключем або діапазоном ключів, як і для `getAll`.
- **`direction`** є необов’язковим аргументом, що вказує який порядок використовувати:
- `"next"` -- типово, курсор піднімається від найнижчого ключа до найвищчого.
- `"prev"` -- зворотний порядок: вниз від запису з найбільшим ключем.
- `"nextunique"`, `"prevunique"` -- те саме, що й вище, але пропускає записи з тим же ключем, який вже був (лише для курсорів за індексами, наприклад, для кількох книг із ціною=5 буде повернута лише перша).
- `"next"` -- типово, курсор піднімається від найнижчого ключа до найвищчого.
- `"prev"` -- зворотний порядок: вниз від запису з найбільшим ключем.
- `"nextunique"`, `"prevunique"` -- те саме, що й вище, але пропускає записи з тим же ключем, який вже був (лише для курсорів за індексами, наприклад, для кількох книг із ціною=5 буде повернута лише перша).

**Основна відмінність курсору полягає в тому, що `request.onsuccess` запускається кілька разів: один раз для кожного результату.**

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@

#Animated circle with callback
#Коло анімоване за допомогою функції.

In the task<info:task/animate-circle>an animated growing circle is shown.
У завданні<info:task/animate-circle>показана анімація зростання кола.

Now let's say we need not just a circle, but to show a message inside it. The message should appear *after* the animation is complete (the circle is fully grown),otherwise it would look ugly.
Припустимо, що нам потрібно показати повідомлення всередині нього. Повідомлення має з’явитися *після* завершення анімації (коли коло повністю виросло),інакше це виглядатиме погано.

In the solution of the task, the function`showCircle(cx, cy, radius)`draws the circle, but gives no way to track when it's ready.
У вирішенні завдання функція`showCircle(cx, cy, radius)`малює коло, але не дає можливості відстежити, коли воно готове.

Add a callback argument: `showCircle(cx, cy, radius, callback)` to be called when the animation is complete. The `callback` should receive the circle`<div>`as an argument.
Додайте аргументом функцію зворотного виклику: `showCircle(cx, cy, radius, callback)`, яка буде викликатися після завершення анімації. Вона має отримувати коло`<div>`як аргумент.

Here's the example:
Ось приклад:

```js
showCircle(150, 150, 100, div => {
Expand All@@ -18,8 +18,8 @@ showCircle(150, 150, 100, div => {
});
```

Demo:
Демо:

[iframe src="solution" height=260]

Take the solution of the task<info:task/animate-circle> as the base.
За основу візьмемо рішення задачі<info:task/animate-circle>
Loading

[8]ページ先頭

©2009-2025 Movatter.jp