diff --git a/1-js/03-code-quality/04-ninja-code/article.md b/1-js/03-code-quality/04-ninja-code/article.md index fece1d52..8ad21003 100644 --- a/1-js/03-code-quality/04-ninja-code/article.md +++ b/1-js/03-code-quality/04-ninja-code/article.md @@ -80,7 +80,7 @@ While choosing a name try to use the most abstract word. Like `obj`, `data`, `va Give them a try. A young ninja may wonder -- do such names make the code worse? Actually, yes! - From one hand, the variable name still means something. It says what's inside the variable: a string, a number or something else. But when an outsider tries to understand the code, he'll be surprised to see that there's actually no information at all! + Sure, the variable name still means something. It says what's inside the variable: a string, a number or something else. But when an outsider tries to understand the code, he'll be surprised to see that there's actually no information at all! Indeed, the value type is easy to find out by debugging. But what's the meaning of the variable? Which string/number does it store? There's just no way to figure out without a good meditation! diff --git a/4-frames-and-windows/06-clickjacking/article.md b/4-frames-and-windows/06-clickjacking/article.md index 17787261..cfd22eba 100644 --- a/4-frames-and-windows/06-clickjacking/article.md +++ b/4-frames-and-windows/06-clickjacking/article.md @@ -12,14 +12,14 @@ The idea is very simple. Here's how clickjacking was done with Facebook: -1. A visitor is lured to the evil page. No matter how. -2. The page has a harmlessly-looking link on it (like "get rich now" or "click here, very funny" and so on). +1. A visitor is lured to the evil page. It doesn't matter how. +2. The page has a harmless-looking link on it (like "get rich now" or "click here, very funny"). 3. Over that link the evil page positions a transparent ` -Depending on the browser, `iframe` above is either empty or it has a message telling that "the browser can't show it". +Depending on your browser, the `iframe` above is either empty or alerting you that the browser won't permit that page to be navigating in this way. ## Showing with disabled functionality -The protecting `X-Frame-Options` header has a side-effect. Other sites can't show our page in an `iframe`, even if they have "legal" reasons to do so. +The `X-Frame-Options` header has a side-effect. Other sites won't be able to show our page in a frame, even if they have good reasons to do so. -So there are other solutions. For instance, we can "cover" the page with a `
` with `height:100%;width:100%`, so that it handles all clicks. That `
` should disappear if `window == top` or we figure out that we don't need protection. +So there are other solutions... For instance, we can "cover" the page with a `
` with `height: 100%; width: 100%;`, so that it intercepts all clicks. That `
` should disappear if `window == top` or if we figure out that we don't need the protection. -Like this: +Something like this: ```html