Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions files/en-us/glossary/preflight_request/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ For example, a client might be asking a server if it would allow a {{HTTPMethod(
OPTIONS /resource/foo
Access-Control-Request-Method: DELETE
Access-Control-Request-Headers: x-requested-with
Origin: https://foo.bar.org
Origin: https://www.example.com
```

If the server allows it, then it will respond to the preflight request with an {{HTTPHeader("Access-Control-Allow-Methods")}} response header, which lists `DELETE`:

```http
HTTP/1.1 204 No Content
Connection: keep-alive
Access-Control-Allow-Origin: https://foo.bar.org
Access-Control-Allow-Origin: https://www.example.com
Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE
Access-Control-Allow-Headers: X-Requested-With
Access-Control-Max-Age: 86400
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ If the image button is used to submit the form, this control doesn't submit its
So for example when you click on the image at coordinate (123, 456) and it submits via the `get` method, you'll see the values appended to the URL as follows:

```url
http://foo.com?pos.x=123&pos.y=456
https://example.com?pos.x=123&pos.y=456
```

This is a very convenient way to build a "hot map". How these values are sent and retrieved is detailed in the [Sending form data](/en-US/docs/Learn_web_development/Extensions/Forms/Sending_and_retrieving_form_data) article.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ The {{HTMLElement("form")}} element defines how the data will be sent. All of it

The [`action`](/en-US/docs/Web/HTML/Reference/Elements/form#action) attribute defines where the data gets sent. Its value must be a valid relative or absolute [URL](/en-US/docs/Learn_web_development/Howto/Web_mechanics/What_is_a_URL). If this attribute isn't provided, the data will be sent to the URL of the page containing the form — the current page.

In this example, the data is sent to an absolute URL — `https://example.com`:
In this example, the data is sent to an absolute URL — `https://www.example.com`:

```html
<form action="https://example.com">…</form>
<form action="https://www.example.com">…</form>
```

Here, we use a relative URL — the data is sent to a different URL on the same origin:
Expand Down Expand Up @@ -93,7 +93,7 @@ The [`GET` method](/en-US/docs/Web/HTTP/Reference/Methods/GET) is the method use
Consider the following form:

```html
<form action="http://www.foo.com" method="GET">
<form action="https://www.example.com/greet" method="GET">
<div>
<label for="say">What greeting do you want to say?</label>
<input name="say" id="say" value="Hi" />
Expand All @@ -108,7 +108,7 @@ Consider the following form:
</form>
```

Since the `GET` method has been used, you'll see the URL `www.foo.com/?say=Hi&to=Mom` appear in the browser address bar when you submit the form.
Since the `GET` method has been used, you'll see the URL `https://www.example.com/greet?say=Hi&to=Mom` appear in the browser address bar when you submit the form.

![The changed url with query parameters after submitting the form with GET method with a "server not found" browser error page](url-parameters.png)

Expand All @@ -121,7 +121,7 @@ The HTTP request looks like this:

```http
GET /?say=Hi&to=Mom HTTP/2.0
Host: foo.com
Host: example.com
```

> [!NOTE]
Expand All @@ -137,7 +137,7 @@ The [`POST` method](/en-US/docs/Web/HTTP/Reference/Methods/POST) is a little dif
Let's look at an example — this is the same form we looked at in the `GET` section above, but with the [`method`](/en-US/docs/Web/HTML/Reference/Elements/form#method) attribute set to `POST`.

```html
<form action="http://www.foo.com" method="POST">
<form action="https://www.example.com/greet" method="POST">
<div>
<label for="say">What greeting do you want to say?</label>
<input name="say" id="say" value="Hi" />
Expand All @@ -156,7 +156,7 @@ When the form is submitted using the `POST` method, you get no data appended to

```http
POST / HTTP/2.0
Host: foo.com
Host: example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 13

Expand All @@ -178,7 +178,7 @@ HTTP requests are never displayed to the user (if you want to see them, you need
1. Open the developer tools.
2. Select "Network"
3. Select "All"
4. Select "foo.com" in the "Name" tab
4. Select "example.com" in the "Name" tab
5. Select "Request" (Firefox) or "Payload" (Chrome/Edge)

You can then get the form data, as shown in the image below.
Expand Down Expand Up @@ -292,7 +292,10 @@ If you want to send files, you need to take three extra steps:
For example:

```html
<form method="post" action="https://www.foo.com" enctype="multipart/form-data">
<form
method="post"
action="https://example.com/upload"
enctype="multipart/form-data">
<div>
<label for="file">Choose a file</label>
<input type="file" id="file" name="myFile" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The declarative rules are defined by four fields:
> - the action does not change the request.
> - the redirect URL is invalid (e.g., the value of {{WebExtAPIRef("declarativeNetRequest.redirect","redirect.regexSubstitution")}} is not a valid URL).

This is an example rule that blocks all script requests originating from `"foo.com"` to any URL with `"abc"` as a substring:
This is an example rule that blocks all script requests originating from `"example.com"` to any URL with `"abc"` as a substring:

```json
{
Expand All @@ -46,7 +46,7 @@ This is an example rule that blocks all script requests originating from `"foo.c
"action": { "type": "block" },
"condition": {
"urlFilter": "abc",
"initiatorDomains": ["foo.com"],
"initiatorDomains": ["example.com"],
"resourceTypes": ["script"]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ match(request, options)
- : A boolean value that specifies whether to
ignore the query string in the URL. For example, if set to
`true` the `?value=bar` part of
`http://foo.com/?value=bar` would be ignored when performing a match.
`https://example.com/?value=bar` would be ignored when performing a match.
It defaults to `false`.
- `ignoreMethod` {{optional_inline}}
- : A boolean value. When `true`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ matchAll(request,options)
- : A boolean value that specifies whether to
ignore the query string in the URL. For example, if set to
`true` the `?value=bar` part of
`http://foo.com/?value=bar` would be ignored when performing a match.
`https://example.com/?value=bar` would be ignored when performing a match.
It defaults to `false`.
- `ignoreMethod` {{optional_inline}}
- : A boolean value. When `true`,
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/cache/delete/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ delete(request, options)
The available options are:
- `ignoreSearch`
- : A boolean value that specifies whether the matching process should ignore the query string in the URL.
If set to `true`, the `?value=bar` part of `http://foo.com/?value=bar` would be ignored when performing a match.
If set to `true`, the `?value=bar` part of `https://example.com/?value=bar` would be ignored when performing a match.
It defaults to `false`.
- `ignoreMethod`
- : A boolean value that, when set to
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/cache/keys/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ keys(request, options)
- : A boolean value that specifies whether the
matching process should ignore the query string in the URL. If set to
`true`, the `?value=bar` part of
`http://foo.com/?value=bar` would be ignored when performing a match.
`https://example.com/?value=bar` would be ignored when performing a match.
It defaults to `false`.
- `ignoreMethod`
- : A boolean value that, when set to
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/cache/match/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ match(request, options)
- : A boolean value that specifies whether to
ignore the query string in the URL. For example, if set to
`true` the `?value=bar` part of
`http://foo.com/?value=bar` would be ignored when performing a match.
`https://example.com/?value=bar` would be ignored when performing a match.
It defaults to `false`.
- `ignoreMethod`
- : A boolean value that, when set to
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/cache/matchall/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ matchAll(request, options)
- : A boolean value that specifies whether the
matching process should ignore the query string in the URL. If set to
`true`, the `?value=bar` part of
`http://foo.com/?value=bar` would be ignored when performing a match.
`https://example.com/?value=bar` would be ignored when performing a match.
It defaults to `false`.
- `ignoreMethod`
- : A boolean value that, when set to
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/cachestorage/match/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ match(request, options)
- : A boolean value that specifies whether the
matching process should ignore the query string in the URL. For example, if set
to `true`, the `?value=bar` part of
`http://foo.com/?value=bar` would be ignored when performing a match.
`https://example.com/?value=bar` would be ignored when performing a match.
It defaults to `false`.
- `ignoreMethod`
- : A boolean value that, when set to
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/htmlelement/hidden/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The HTML contains two panels: a welcome panel, that asks users to agree to be aw

```html
<div id="welcome" class="panel">
<h1>Welcome to Foobar.com!</h1>
<h1>Welcome to my website!</h1>
<p>By clicking "OK" you agree to be awesome today!</p>
<button class="button" id="okButton">OK</button>
</div>
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/url/url/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ new URL("", "https://example.com/?query=1");
new URL("/a", "https://example.com/?query=1");
// => 'https://example.com/a' (see relative URLs)

new URL("//foo.com", "https://example.com");
// => 'https://foo.com/' (see relative URLs)
new URL("//foo.example", "https://example.com");
// => 'https://foo.example/' (see relative URLs)
```

## Specifications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ p {
This HTML will apply a special stylesheet for devices that have at least 256 colors.

```html
<link rel="stylesheet" href="http://foo.bar.com/base.css" />
<link rel="stylesheet" href="https://cdn.example.com/base.css" />
<link
rel="stylesheet"
media="(color-index >= 256)"
href="http://foo.bar.com/color-stylesheet.css" />
href="https://cdn.example.com/color-stylesheet.css" />
```

## Specifications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The `device-height` feature is specified as a {{cssxref("&lt;length&gt;")}} valu
<link
rel="stylesheet"
media="screen and (max-device-height: 799px)"
href="http://foo.bar.com/short-styles.css" />
href="https://cdn.example.com/short-styles.css" />
```

## Specifications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The `device-width` feature is specified as a {{cssxref("&lt;length&gt;")}} value
<link
rel="stylesheet"
media="screen and (max-device-width: 799px)"
href="http://foo.bar.com/narrow-styles.css" />
href="https://cdn.example.com/narrow-styles.css" />
```

## Specifications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function FindProxyForURL(url, host) {
if (isResolvable(host)) {
return "DIRECT";
}
return "PROXY proxy.mydomain.com:8080";
return "PROXY proxy.example.com:8080";
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ function FindProxyForURL(url, host) {
if (isResolvable(host)) {
return "DIRECT";
}
return "PROXY proxy.mydomain.com:8080";
return "PROXY proxy.example.com:8080";
}
```

Expand All @@ -594,12 +594,12 @@ The above requires consulting the DNS every time; it can be grouped intelligentl
function FindProxyForURL(url, host) {
if (
isPlainHostName(host) ||
dnsDomainIs(host, ".mydomain.com") ||
dnsDomainIs(host, ".example.com") ||
isResolvable(host)
) {
return "DIRECT";
}
return "PROXY proxy.mydomain.com:8080";
return "PROXY proxy.example.com:8080";
}
```

Expand All @@ -614,7 +614,7 @@ function FindProxyForURL(url, host) {
if (isInNet(host, "192.0.2.172", "255.255.0.0")) {
return "DIRECT";
}
return "PROXY proxy.mydomain.com:8080";
return "PROXY proxy.example.com:8080";
}
```

Expand All @@ -624,12 +624,12 @@ Again, use of the DNS server in the above can be minimized by adding redundant r
function FindProxyForURL(url, host) {
if (
isPlainHostName(host) ||
dnsDomainIs(host, ".mydomain.com") ||
dnsDomainIs(host, ".example.com") ||
isInNet(host, "192.0.2.0", "255.255.0.0")
) {
return "DIRECT";
}
return "PROXY proxy.mydomain.com:8080";
return "PROXY proxy.example.com:8080";
}
```

Expand All @@ -650,14 +650,14 @@ All local accesses are desired to be direct. All proxy servers run on the port 8

```js
function FindProxyForURL(url, host) {
if (isPlainHostName(host) || dnsDomainIs(host, ".mydomain.com")) {
if (isPlainHostName(host) || dnsDomainIs(host, ".example.com")) {
return "DIRECT";
} else if (shExpMatch(host, "*.com")) {
return "PROXY proxy1.mydomain.com:8080; PROXY proxy4.mydomain.com:8080";
return "PROXY proxy1.example.com:8080; PROXY proxy4.example.com:8080";
} else if (shExpMatch(host, "*.edu")) {
return "PROXY proxy2.mydomain.com:8080; PROXY proxy4.mydomain.com:8080";
return "PROXY proxy2.example.com:8080; PROXY proxy4.example.com:8080";
}
return "PROXY proxy3.mydomain.com:8080; PROXY proxy4.mydomain.com:8080";
return "PROXY proxy3.example.com:8080; PROXY proxy4.example.com:8080";
}
```

Expand All @@ -670,13 +670,13 @@ Most of the standard JavaScript functionality is available for use in the `FindP
```js
function FindProxyForURL(url, host) {
if (url.startsWith("http:")) {
return "PROXY http-proxy.mydomain.com:8080";
return "PROXY http-proxy.example.com:8080";
} else if (url.startsWith("ftp:")) {
return "PROXY ftp-proxy.mydomain.com:8080";
return "PROXY ftp-proxy.example.com:8080";
} else if (url.startsWith("gopher:")) {
return "PROXY gopher-proxy.mydomain.com:8080";
return "PROXY gopher-proxy.example.com:8080";
} else if (url.startsWith("https:") || url.startsWith("snews:")) {
return "PROXY security-proxy.mydomain.com:8080";
return "PROXY security-proxy.example.com:8080";
}
return "DIRECT";
}
Expand All @@ -689,7 +689,7 @@ For example:

```js
if (shExpMatch(url, "http:*")) {
return "PROXY http-proxy.mydomain.com:8080";
return "PROXY http-proxy.example.com:8080";
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ The preflight request below tells the server that we want to send a CORS `GET` r
OPTIONS /resource/foo
Access-Control-Request-Method: GET
Access-Control-Request-Headers: content-type,x-requested-with
Origin: https://foo.bar.org
Origin: https://www.example.com
```

#### Response
Expand All @@ -96,7 +96,7 @@ If the CORS request indicated by the preflight request is authorized, the server
HTTP/1.1 200 OK
Content-Length: 0
Connection: keep-alive
Access-Control-Allow-Origin: https://foo.bar.org
Access-Control-Allow-Origin: https://www.example.com
Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE
Access-Control-Allow-Headers: Content-Type, x-requested-with
Access-Control-Max-Age: 86400
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ The [Unicode property escapes](/en-US/docs/Web/JavaScript/Reference/Regular_expr
### Extracting subdomain name from URL

```js
const url = "http://xxx.domain.com";
const url = "http://xxx.example.com";
console.log(/^https?:\/\/(.+?)\./.exec(url)[1]); // 'xxx'
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ If a non-same-origin `start_url` is specified, browsers will fallback to using t

- **Fingerprinting**:

Encoding strings into `start_url` to uniquely identify users (e.g., server-assigned identifiers, such as `?user=123`, `/user/123/`, or `https://user123.foo.bar`) creates a persistent fingerprint.
Encoding strings into `start_url` to uniquely identify users (e.g., server-assigned identifiers, such as `?user=123`, `/user/123/`, or `https://user123.example.com`) creates a persistent fingerprint.
Users may not be aware that their privacy-sensitive information can persist even after they've cleared site data.
It is bad practice to include any information in `start_url` that could uniquely identify users.

Expand Down