Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New docs area for URL semantics, relocate some HTTP pages here #35202

Merged
merged 17 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from 10 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
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Content:Other:
- files/en-us/web/exslt/**
- files/en-us/web/opensearch/**
- files/en-us/web/privacy/**
- files/en-us/web/text_fragments/**
- files/en-us/web/uri/**
- files/en-us/web/xml/**
- files/en-us/web/xpath/**
- files/en-us/web/xslt/**
26 changes: 16 additions & 10 deletions files/en-us/_redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3612,7 +3612,7 @@
/en-US/docs/Glossary/Static_property /en-US/docs/Glossary/property/JavaScript
/en-US/docs/Glossary/Transferable_objects /en-US/docs/Web/API/Web_Workers_API/Transferable_objects
/en-US/docs/Glossary/Transmission_Control_Protocol_(TCP) /en-US/docs/Glossary/TCP
/en-US/docs/Glossary/URI/www_vs_non-www_URLs /en-US/docs/Web/HTTP/Basics_of_HTTP/Choosing_between_www_and_non-www_URLs
/en-US/docs/Glossary/URI/www_vs_non-www_URLs /en-US/docs/Web/URI/Authority/Choosing_between_www_and_non-www_URLs
/en-US/docs/Glossary/WWW /en-US/docs/Glossary/World_Wide_Web
/en-US/docs/Glossary/WebExtension /en-US/docs/Glossary/WebExtensions
/en-US/docs/Glossary/Web_Sockets /en-US/docs/Glossary/WebSockets
Expand Down Expand Up @@ -6864,7 +6864,7 @@
/en-US/docs/The_XSLT_JavaScript_Interface_in_Gecko:Resources /en-US/docs/Web/API/XSLTProcessor
/en-US/docs/The_XSLT_JavaScript_Interface_in_Gecko:Setting_Parameters /en-US/docs/Web/API/XSLTProcessor
/en-US/docs/The_add-on_bar /en-US/docs/Mozilla/Firefox/Releases/4/The_add-on_bar
/en-US/docs/The_data_URL_scheme /en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs
/en-US/docs/The_data_URL_scheme /en-US/docs/Web/URI/Schemes/data
/en-US/docs/Thunderbird/Autoconfiguration https://www.bucksch.org/1/projects/thunderbird/autoconfiguration/
/en-US/docs/Thunderbird/Autoconfiguration/FileFormat/Definition https://www.bucksch.org/1/projects/thunderbird/autoconfiguration/config-file-format.html
/en-US/docs/Thunderbird/Autoconfiguration/FileFormat/HowTo https://www.bucksch.org/1/projects/thunderbird/autoconfiguration/how-to-create-your-own
Expand Down Expand Up @@ -7291,8 +7291,8 @@
/en-US/docs/Transforming_XML_with_XSLT:The_Netscape_XSLT_XPath_Reference:Functions /en-US/docs/Web/XPath/Functions
/en-US/docs/Traversing_an_HTML_table_with_JavaScript_and_DOM_Interfaces /en-US/docs/Web/API/Document_Object_Model/Traversing_an_HTML_table_with_JavaScript_and_DOM_Interfaces
/en-US/docs/URI /en-US/docs/Glossary/URI
/en-US/docs/URI/www and non-www URLs /en-US/docs/Web/HTTP/Basics_of_HTTP/Choosing_between_www_and_non-www_URLs
/en-US/docs/URI/www_vs_non-www_URLs /en-US/docs/Web/HTTP/Basics_of_HTTP/Choosing_between_www_and_non-www_URLs
/en-US/docs/URI/www and non-www URLs /en-US/docs/Web/URI/Authority/Choosing_between_www_and_non-www_URLs
/en-US/docs/URI/www_vs_non-www_URLs /en-US/docs/Web/URI/Authority/Choosing_between_www_and_non-www_URLs
/en-US/docs/URL.createObjectURL /en-US/docs/Web/API/URL/createObjectURL_static
/en-US/docs/URLUtilsReadOnly.origin /en-US/docs/Web/API/WorkerLocation/origin
/en-US/docs/USA /en-US/docs/Web/Progressive_web_apps
Expand Down Expand Up @@ -11129,6 +11129,7 @@
/en-US/docs/Web/Apps/app_layout/Mobile_first /en-US/docs/Learn/CSS/CSS_layout/Responsive_Design
/en-US/docs/Web/Apps/app_layout/responsive_design_building_blocks /en-US/docs/Learn/CSS/CSS_layout/Responsive_Design
/en-US/docs/Web/Apps_clone /en-US/docs/Web/Progressive_web_apps
/en-US/docs/Web/Basics_of_HTTP/Identifying_resources_on_the_Web /en-US/docs/Web/URI
/en-US/docs/Web/CSS/-epub-caption-side /en-US/docs/Web/CSS/caption-side
/en-US/docs/Web/CSS/-epub-text-transform /en-US/docs/Web/CSS/text-transform
/en-US/docs/Web/CSS/-moz-alias /en-US/docs/Web/CSS/cursor
Expand Down Expand Up @@ -12287,9 +12288,12 @@
/en-US/docs/Web/HTML/element/content /en-US/docs/Web/HTML/element/slot
/en-US/docs/Web/HTTP/Access_control_CORS /en-US/docs/Web/HTTP/CORS
/en-US/docs/Web/HTTP/Basic_access_authentication /en-US/docs/Web/HTTP/Authentication
/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs /en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs
/en-US/docs/Web/HTTP/Basics_of_HTTP/Introduction_to_www_and_non-www_URLs /en-US/docs/Web/HTTP/Basics_of_HTTP/Choosing_between_www_and_non-www_URLs
/en-US/docs/Web/HTTP/Basics_of_HTTP/Choosing_between_www_and_non-www_URLs /en-US/docs/Web/URI/Authority/Choosing_between_www_and_non-www_URLs
/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs /en-US/docs/Web/URI/Schemes/data
/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs /en-US/docs/Web/URI/Schemes/data
/en-US/docs/Web/HTTP/Basics_of_HTTP/Introduction_to_www_and_non-www_URLs /en-US/docs/Web/URI/Authority/Choosing_between_www_and_non-www_URLs
/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types /en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
/en-US/docs/Web/HTTP/Basics_of_HTTP/Resource_URLs /en-US/docs/Web/URI/Schemes/resource
/en-US/docs/Web/HTTP/CORS/Errors/Reason:_CORS_header_‘Origin’_cannot_be_added /en-US/docs/Web/HTTP/CORS/Errors/CORSOriginHeaderNotAdded
/en-US/docs/Web/HTTP/Caching_FAQ /en-US/docs/Web/HTTP/Caching
/en-US/docs/Web/HTTP/Controlling_DNS_prefetching /en-US/docs/Web/HTTP/Headers/X-DNS-Prefetch-Control
Expand Down Expand Up @@ -12355,15 +12359,16 @@
/en-US/docs/Web/HTTP/Pipelining_FAQ /en-US/docs/Web/HTTP/Connection_management_in_HTTP_1.x
/en-US/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_(PAC)_file /en-US/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_PAC_file
/en-US/docs/Web/HTTP/Public_Key_Pinning /en-US/docs/Web/Security/Certificate_Transparency
/en-US/docs/Web/HTTP/Resources_and_URIs /en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types
/en-US/docs/Web/HTTP/Response_codes /en-US/docs/Web/HTTP/Status
/en-US/docs/Web/HTTP/Server-Side_Access_Control /en-US/docs/Web/HTTP/CORS
/en-US/docs/Web/HTTP/Status/416_Range_Not_Satisfiable /en-US/docs/Web/HTTP/Status/416
/en-US/docs/Web/HTTP/Status/418_I_m_a_teapot /en-US/docs/Web/HTTP/Status/418
/en-US/docs/Web/HTTP/Status/506_Variant_Also_Negotiates /en-US/docs/Web/HTTP/Status/506
/en-US/docs/Web/HTTP/Status/510_Not_Extended /en-US/docs/Web/HTTP/Status/510
/en-US/docs/Web/HTTP/X-Frame-Options /en-US/docs/Web/HTTP/Headers/X-Frame-Options
/en-US/docs/Web/HTTP/data_URIs /en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs
/en-US/docs/Web/HTTP/www_and_non-www_URLs /en-US/docs/Web/HTTP/Basics_of_HTTP/Choosing_between_www_and_non-www_URLs
/en-US/docs/Web/HTTP/data_URIs /en-US/docs/Web/URI/Schemes/data
/en-US/docs/Web/HTTP/www_and_non-www_URLs /en-US/docs/Web/URI/Authority/Choosing_between_www_and_non-www_URLs
/en-US/docs/Web/Houdini /en-US/docs/Web/API/Houdini_APIs
/en-US/docs/Web/Houdini/CSS_Painting_API /en-US/docs/Web/API/CSS_Painting_API/Guide
/en-US/docs/Web/Houdini/CSS_Typed_OM /en-US/docs/Web/API/CSS_Typed_OM_API
Expand Down Expand Up @@ -13060,6 +13065,7 @@
/en-US/docs/Web/Security/Securing_your_site /en-US/docs/Web/Security/Practical_implementation_guides
/en-US/docs/Web/Security/Securing_your_site/Configuring_server_MIME_types /en-US/docs/Learn/Server-side/Configuring_server_MIME_types
/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion /en-US/docs/Web/Security/Practical_implementation_guides/Turning_off_form_autocompletion
/en-US/docs/Web/Text_fragments /en-US/docs/Web/URI/Fragment/Text_fragments
/en-US/docs/Web/WebDriver/Commands/New_Window /en-US/docs/Web/WebDriver/Commands/NewWindow
/en-US/docs/Web/WebGL /en-US/docs/Web/API/WebGL_API
/en-US/docs/Web/WebGL/Adding_2D_content_to_a_WebGL_context /en-US/docs/Web/API/WebGL_API/Tutorial/Adding_2D_content_to_a_WebGL_context
Expand Down Expand Up @@ -13548,7 +13554,7 @@
/en-US/docs/cssText /en-US/docs/Web/API/CSSRule/cssText
/en-US/docs/ctrlKey /en-US/docs/Web/API/MouseEvent/ctrlKey
/en-US/docs/currentTarget /en-US/docs/Web/API/Event/currentTarget
/en-US/docs/data_URIs /en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs
/en-US/docs/data_URIs /en-US/docs/Web/URI/Schemes/data
/en-US/docs/de_temp /en-US/docs/Web/API/document/documentElement
/en-US/docs/defineGetter /en-US/docs/Web/JavaScript/Guide/Working_with_objects
/en-US/docs/defineSetter /en-US/docs/Web/JavaScript/Guide/Working_with_objects
Expand Down Expand Up @@ -13804,7 +13810,7 @@
/en-US/docs/window.toolbar /en-US/docs/Web/API/Window/toolbar
/en-US/docs/window.unescape /en-US/docs/Web/JavaScript/Reference/Global_Objects/unescape
/en-US/docs/window.window /en-US/docs/Web/API/Window/window
/en-US/docs/www_vs_non-www_URLs /en-US/docs/Web/HTTP/Basics_of_HTTP/Choosing_between_www_and_non-www_URLs
/en-US/docs/www_vs_non-www_URLs /en-US/docs/Web/URI/Authority/Choosing_between_www_and_non-www_URLs
/en-US/docs/xml:base /en-US/docs/Web/API/Node/baseURI
/en-US/docs/zh-n/JavaScript/Reference/Global_Objects/String/quote /zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/quote
/en-US/docs/zh_cn /zh-CN/docs/Web
166 changes: 81 additions & 85 deletions files/en-us/_wikihistory.json
Original file line number Diff line number Diff line change
Expand Up @@ -98453,70 +98453,6 @@
"fscholz"
]
},
"Web/HTTP/Basics_of_HTTP/Choosing_between_www_and_non-www_URLs": {
"modified": "2020-02-15T14:08:06.893Z",
"contributors": [
"francoraphael",
"ExE-Boss",
"Alpha",
"MechaLynx",
"nckx",
"xavdid",
"david_ross",
"fscholz",
"teoli",
"chrisdavidmills",
"ethertank",
"dbruant"
]
},
"Web/HTTP/Basics_of_HTTP/Data_URLs": {
"modified": "2020-11-21T14:56:28.316Z",
"contributors": [
"simon04",
"idleray",
"pygy",
"cvickery",
"hinell",
"mfuji09",
"aetonsi",
"Peppesterest",
"Alpha",
"chrisdavidmills",
"Ethan",
"fscholz",
"DomenicDenicola",
"HTMLValidator",
"teoli",
"Jonathan_Watt",
"oldhill",
"groovecoder",
"ajdavdson1",
"ModMaker",
"jsx",
"Butterfly87",
"Delapouite",
"valentin.gosu",
"Sheppy",
"Emmanuel_Vallois",
"Null",
"jwhittaker",
"kscarfone",
"fusionchess",
"brianblakely",
"ziyunfei",
"Rob W",
"nK0de",
"jreschke",
"boaz",
"toja",
"Sevenspade",
"Sephr",
"Nickolay",
"Np",
"Waldo"
]
},
"Web/HTTP/Basics_of_HTTP/Evolution_of_HTTP": {
"modified": "2020-09-25T15:02:32.165Z",
"contributors": [
Expand All @@ -98541,19 +98477,6 @@
"teoli"
]
},
"Web/HTTP/Basics_of_HTTP/Identifying_resources_on_the_Web": {
"modified": "2020-11-16T01:23:20.622Z",
"contributors": [
"prajaraksh",
"Sheppy",
"evansdianga",
"danielgormly",
"neel-hektor",
"david_ross",
"teoli",
"fscholz"
]
},
"Web/HTTP/Basics_of_HTTP/MIME_types": {
"modified": "2019-11-03T12:37:56.527Z",
"contributors": [
Expand Down Expand Up @@ -98623,10 +98546,6 @@
"teoli"
]
},
"Web/HTTP/Basics_of_HTTP/Resource_URLs": {
"modified": "2019-03-23T22:04:02.489Z",
"contributors": ["ExE-Boss", "gmierz", "David_B", "chrisdavidmills"]
},
"Web/HTTP/Browser_detection_using_the_user_agent": {
"modified": "2020-07-11T11:53:53.804Z",
"contributors": [
Expand Down Expand Up @@ -100880,10 +100799,6 @@
"teoli"
]
},
"Web/HTTP/Resources_and_URIs": {
"modified": "2020-03-26T15:01:51.205Z",
"contributors": ["pettll", "Sheppy", "teoli", "fscholz"]
},
"Web/HTTP/Resources_and_specifications": {
"modified": "2019-07-29T05:42:08.432Z",
"contributors": [
Expand Down Expand Up @@ -126900,6 +126815,87 @@
"alispivak"
]
},
"Web/URI": {
"modified": "2020-11-16T01:23:20.622Z",
"contributors": [
"prajaraksh",
"Sheppy",
"evansdianga",
"danielgormly",
"neel-hektor",
"david_ross",
"teoli",
"fscholz"
]
},
"Web/URI/Authority/Choosing_between_www_and_non-www_URLs": {
"modified": "2020-02-15T14:08:06.893Z",
"contributors": [
"francoraphael",
"ExE-Boss",
"Alpha",
"MechaLynx",
"nckx",
"xavdid",
"david_ross",
"fscholz",
"teoli",
"chrisdavidmills",
"ethertank",
"dbruant"
]
},
"Web/URI/Schemes/data": {
"modified": "2020-11-21T14:56:28.316Z",
"contributors": [
"simon04",
"idleray",
"pygy",
"cvickery",
"hinell",
"mfuji09",
"aetonsi",
"Peppesterest",
"Alpha",
"chrisdavidmills",
"Ethan",
"fscholz",
"DomenicDenicola",
"HTMLValidator",
"teoli",
"Jonathan_Watt",
"oldhill",
"groovecoder",
"ajdavdson1",
"ModMaker",
"jsx",
"Butterfly87",
"Delapouite",
"valentin.gosu",
"Sheppy",
"Emmanuel_Vallois",
"Null",
"jwhittaker",
"kscarfone",
"fusionchess",
"brianblakely",
"ziyunfei",
"Rob W",
"nK0de",
"jreschke",
"boaz",
"toja",
"Sevenspade",
"Sephr",
"Nickolay",
"Np",
"Waldo"
]
},
"Web/URI/Schemes/resource": {
"modified": "2019-03-23T22:04:02.489Z",
"contributors": ["ExE-Boss", "gmierz", "David_B", "chrisdavidmills"]
},
"Web/WebDriver": {
"modified": "2020-10-15T22:03:17.889Z",
"contributors": [
Expand Down
6 changes: 3 additions & 3 deletions files/en-us/glossary/base64/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ When the term "Base64" is used on its own to refer to a specific {{glossary("alg
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
```

A common variant is "Base64 URL safe", which omits the padding and replaces `+/` with `-_` to avoid characters that might cause problems in {{glossary("URL")}} path segments or query parameters. You don't need this encoding if you are not putting the data in a path segment or query parameter — for example, [data URLs](/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs) have neither and can use the standard Base64 encoding.
A common variant is "Base64 URL safe", which omits the padding and replaces `+/` with `-_` to avoid characters that might cause problems in {{glossary("URL")}} path segments or query parameters. You don't need this encoding if you are not putting the data in a path segment or query parameter — for example, [data URLs](/en-US/docs/Web/URI/Schemes/data) have neither and can use the standard Base64 encoding.

Base64 encoding schemes are commonly used to encode binary data for storage or transfer over media that can only deal with ASCII text (or some superset of ASCII that still falls short of accepting arbitrary binary data). This ensures that the data remains intact without modification during transport. Common applications of Base64 include:

- Email via [MIME](https://en.wikipedia.org/wiki/MIME)
- Storing complex data in [XML](/en-US/docs/Web/XML)
- Encoding binary data so that it can be included in a [`data:` URL](/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs)
- Encoding binary data so that it can be included in a [`data:` URL](/en-US/docs/Web/URI/Schemes/data)

## Encoded size increase

Expand Down Expand Up @@ -96,6 +96,6 @@ await dataUrlToBytes("data:application/octet-stream;base64,AAEC"); // Uint8Array
- JavaScript APIs:
- {{domxref("Window.atob()")}} (also {{domxref("WorkerGlobalScope.atob()", "available in workers", "", "nocode")}})
- {{domxref("Window.btoa()")}} (also {{domxref("WorkerGlobalScope.btoa()", "available in workers", "", "nocode")}})
- [Data URLs](/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs)
- [Data URLs](/en-US/docs/Web/URI/Schemes/data)
- [Base64](https://en.wikipedia.org/wiki/Base64) on Wikipedia
- Base64 Algorithm described in [RFC 4648](https://datatracker.ietf.org/doc/html/rfc4648)
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ The {{Glossary("HTML")}} language — [which will be discussed later on](/en-US/
- to display other HTML documents with the {{HTMLElement("iframe")}} element.

> [!NOTE]
> When specifying URLs to load resources as part of a page (such as when using the `<script>`, `<audio>`, `<img>`, `<video>`, and the like), you should generally only use HTTP and HTTPS URLs, with few exceptions (one notable one being `data:`; see [Data URLs](/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs)). Using FTP, for example, is not secure and is no longer supported by modern browsers.
> When specifying URLs to load resources as part of a page (such as when using the `<script>`, `<audio>`, `<img>`, `<video>`, and the like), you should generally only use HTTP and HTTPS URLs, with few exceptions (one notable one being `data:`; see [Data URLs](/en-US/docs/Web/URI/Schemes/data)). Using FTP, for example, is not secure and is no longer supported by modern browsers.

Other technologies, such as {{Glossary("CSS")}} or {{Glossary("JavaScript")}}, use URLs extensively, and these are really the heart of the Web.

Expand Down Expand Up @@ -149,4 +149,4 @@ Linguistic semantics are of course irrelevant to computers. You've probably ofte

## See also

[Data URLs](/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs): URLs prefixed with the `data:` scheme, allow content creators to embed small files inline in documents.
[Data URLs](/en-US/docs/Web/URI/Schemes/data): URLs prefixed with the `data:` scheme, allow content creators to embed small files inline in documents.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ The set of domains can be restricted further through enterprise policies: Firefo

### Limitations

Whole tabs or frames may be loaded using [`data:` URI](/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs), {{DOMxRef("URL.createObjectURL_static", "Blob")}} objects, and other similar techniques. Support of content scripts injection into such special documents varies across browsers, see the Firefox [bug #1411641 comment 41](https://bugzil.la/1411641#c41) for some details.
Whole tabs or frames may be loaded using [`data:` URI](/en-US/docs/Web/URI/Schemes/data), {{DOMxRef("URL.createObjectURL_static", "Blob")}} objects, and other similar techniques. Support of content scripts injection into such special documents varies across browsers, see the Firefox [bug #1411641 comment 41](https://bugzil.la/1411641#c41) for some details.

## Content script environment

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ Also see the source code — [HTML](https://github.com/mdn/dom-examples/blob/mai

## Saving images

The {{domxref("HTMLCanvasElement")}} provides a `toDataURL()` method, which is useful when saving images. It returns a [data URL](/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs) containing a representation of the image in the format specified by the `type` parameter (defaults to [PNG](https://en.wikipedia.org/wiki/Portable_Network_Graphics)). The returned image is in a resolution of 96 dpi.
The {{domxref("HTMLCanvasElement")}} provides a `toDataURL()` method, which is useful when saving images. It returns a [data URL](/en-US/docs/Web/URI/Schemes/data) containing a representation of the image in the format specified by the `type` parameter (defaults to [PNG](https://en.wikipedia.org/wiki/Portable_Network_Graphics)). The returned image is in a resolution of 96 dpi.

> [!NOTE]
> Be aware that if the canvas contains any pixels that were obtained from another {{Glossary("origin")}} without using CORS, the canvas is **tainted** and its contents can no longer be read and saved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ draw();

### Embedding an image via data: URL

Another possible way to include images is via the [data: URL](/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs). Data URLs allow you to completely define an image as a Base64 encoded string of characters directly in your code.
Another possible way to include images is via the [data: URL](/en-US/docs/Web/URI/Schemes/data). Data URLs allow you to completely define an image as a Base64 encoded string of characters directly in your code.

```js
const img = new Image(); // Create new img element
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/document/domain/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The getter for this property returns the domain portion of the current document'
origin. In most cases, this will be the hostname portion of the document's URL. However,
there are some exceptions:

- If the page has an opaque {{glossary("origin")}}, e.g. for a page with a [data URL](/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs), then it will
- If the page has an opaque {{glossary("origin")}}, e.g. for a page with a [data URL](/en-US/docs/Web/URI/Schemes/data), then it will
return the empty string.
- If the `document.domain` [setter](#setting_the_domain) has been used, then
it will return the value that was set.
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/document/fragmentdirective/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ This functionality is mainly intended for feature detection at present. In the f

## See also

- [Text fragments](/en-US/docs/Web/Text_fragments)
- [Text fragments](/en-US/docs/Web/URI/Fragment/Text_fragments)
- {{cssxref("::target-text")}}
Loading