@mdn/fred 1.6.2 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env-dist +4 -0
- package/CHANGELOG.md +25 -0
- package/build/eslint-fred.js +6 -4
- package/build/plugins/generate-element-map.js +3 -2
- package/build/utils.js +0 -23
- package/components/curriculum/module.css +1 -0
- package/components/curriculum-module/server.css +1 -0
- package/components/env/index.js +3 -0
- package/components/footer/server.js +1 -1
- package/components/live-sample-result/element.js +1 -0
- package/components/menu/base.css +2 -1
- package/components/menu/constants.js +443 -147
- package/components/menu/missing-docs.json +140 -0
- package/components/menu/server.js +78 -657
- package/components/menu/types.d.ts +50 -0
- package/components/menu/update-missing-docs.js +66 -0
- package/components/outer-layout/utils.js +2 -2
- package/components/play-runner/element.js +14 -6
- package/entry.client.js +1 -0
- package/hooks/ga-init.js +31 -0
- package/hooks/glean-init.js +2 -6
- package/l10n/fr.ftl +145 -1
- package/out/service-worker.js +1 -1
- package/out/service-worker.js.map +1 -1
- package/out/static/client/{6480.09f744cd2fb69ed8.js → 6480.c839ead24f125a7e.js} +3 -2
- package/out/static/client/{6480.09f744cd2fb69ed8.js.map → 6480.c839ead24f125a7e.js.map} +1 -1
- package/out/static/client/9914.021220acc0d3e777.js +11 -0
- package/out/static/client/9914.021220acc0d3e777.js.map +1 -0
- package/out/static/client/index.0f1f5c05b3c9458b.js +412 -0
- package/out/static/client/index.0f1f5c05b3c9458b.js.map +1 -0
- package/out/static/client/{runtime.b178b9749f31202a.js → runtime.f3c0cd5b45c6e874.js} +2 -2
- package/out/static/client/{runtime.b178b9749f31202a.js.map → runtime.f3c0cd5b45c6e874.js.map} +1 -1
- package/out/static/client/stats.json +116 -116
- package/out/static/client/styles-curriculum-landing.cbaf6ff367369a26.css.map +1 -1
- package/out/static/client/styles-curriculum-module.c7ec78d3e724cf64.css.map +1 -1
- package/out/static/client/{styles-global.fb7afecd89ca2dff.js → styles-global.52fa98f0e9ec0040.js} +1 -1
- package/out/static/client/{styles-global.684fd2c5254c94b8.css → styles-global.75b8c75561733419.css} +2 -2
- package/out/static/client/{styles-global.684fd2c5254c94b8.css.map → styles-global.75b8c75561733419.css.map} +1 -1
- package/out/static/client/styles-menu.c41c14be9597dcd9.css +2 -0
- package/out/static/client/styles-menu.c41c14be9597dcd9.css.map +1 -0
- package/out/static/legacy/asset-manifest.json +5 -5
- package/out/static/legacy/{index.ad3600b01e18974e.html → index.4d5b9af908771553.html} +1 -1
- package/out/static/legacy/{index.5592b02d966df8ba.js → index.e275f57e34e5ad42.js} +3 -3
- package/out/static/legacy/{index.5592b02d966df8ba.js.map → index.e275f57e34e5ad42.js.map} +1 -1
- package/out/static/legacy/stats.json +10 -10
- package/out/static/legacy/{yari.8ce0be252d1ae155.js → yari.28c752c4002c881d.js} +3 -3
- package/out/static/legacy/{yari.8ce0be252d1ae155.js.map → yari.28c752c4002c881d.js.map} +1 -1
- package/out/static/ssr/index.js +306 -580
- package/out/static/ssr/index.js.map +1 -1
- package/out/static/ssr/stats.json +4 -4
- package/package.json +9 -9
- package/utils/dnt-helper.js +59 -0
- package/utils/name-transformation.js +40 -0
- package/utils/telemetry-opt-out.js +12 -0
- package/components/menu/check-missing-docs.js +0 -44
- package/out/static/client/9914.251fe19f0038e97b.js +0 -11
- package/out/static/client/9914.251fe19f0038e97b.js.map +0 -1
- package/out/static/client/index.26176fe4ab13dce5.js +0 -268
- package/out/static/client/index.26176fe4ab13dce5.js.map +0 -1
- package/out/static/client/styles-menu.5193bf2642ae7d64.css +0 -2
- package/out/static/client/styles-menu.5193bf2642ae7d64.css.map +0 -1
- /package/out/static/client/{6480.09f744cd2fb69ed8.js.LICENSE.txt → 6480.c839ead24f125a7e.js.LICENSE.txt} +0 -0
- /package/out/static/client/{index.26176fe4ab13dce5.js.LICENSE.txt → index.0f1f5c05b3c9458b.js.LICENSE.txt} +0 -0
- /package/out/static/legacy/{index.5592b02d966df8ba.js.LICENSE.txt → index.e275f57e34e5ad42.js.LICENSE.txt} +0 -0
- /package/out/static/legacy/{yari.8ce0be252d1ae155.js.LICENSE.txt → yari.28c752c4002c881d.js.LICENSE.txt} +0 -0
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"assets": [
|
|
10
10
|
{
|
|
11
11
|
"name": "index.js",
|
|
12
|
-
"size":
|
|
12
|
+
"size": 1421436
|
|
13
13
|
}
|
|
14
14
|
],
|
|
15
15
|
"filteredAssets": 0,
|
|
16
|
-
"assetsSize":
|
|
16
|
+
"assetsSize": 1421436,
|
|
17
17
|
"auxiliaryAssets": [
|
|
18
18
|
{
|
|
19
19
|
"name": "desktop-saving-page.bbb8eedefb3e848f.png",
|
|
@@ -317,7 +317,7 @@
|
|
|
317
317
|
},
|
|
318
318
|
{
|
|
319
319
|
"name": "index.js.map",
|
|
320
|
-
"size":
|
|
320
|
+
"size": 4226246
|
|
321
321
|
},
|
|
322
322
|
{
|
|
323
323
|
"name": "deno.aed70d20abbf1067.svg",
|
|
@@ -512,7 +512,7 @@
|
|
|
512
512
|
"size": 135602
|
|
513
513
|
}
|
|
514
514
|
],
|
|
515
|
-
"auxiliaryAssetsSize":
|
|
515
|
+
"auxiliaryAssetsSize": 8689233,
|
|
516
516
|
"children": {},
|
|
517
517
|
"childAssets": {}
|
|
518
518
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mdn/fred",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"repository": "https://github.com/mdn/fred",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"author": "MDN Web Docs",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@lit-labs/ssr": "^3.3.1",
|
|
45
45
|
"@lit-labs/ssr-client": "^1.1.7",
|
|
46
46
|
"@lit/task": "^1.0.3",
|
|
47
|
-
"@mdn/rari": "0.1.
|
|
47
|
+
"@mdn/rari": "0.1.53",
|
|
48
48
|
"@mdn/watify": "^1.1.3",
|
|
49
49
|
"@mozilla/glean": "^5.0.6",
|
|
50
50
|
"codemirror": "^6.0.1",
|
|
@@ -71,10 +71,10 @@
|
|
|
71
71
|
"@codemirror/view": "^6.38.6",
|
|
72
72
|
"@csstools/postcss-global-data": "^3.1.0",
|
|
73
73
|
"@eslint/compat": "^1.4.0",
|
|
74
|
-
"@eslint/js": "^9.
|
|
74
|
+
"@eslint/js": "^9.38.0",
|
|
75
75
|
"@jackolope/lit-analyzer": "^3.2.0",
|
|
76
76
|
"@jackolope/ts-lit-plugin": "^3.1.6",
|
|
77
|
-
"@mdn/browser-compat-data": "^7.1.
|
|
77
|
+
"@mdn/browser-compat-data": "^7.1.14",
|
|
78
78
|
"@mdn/yari": "^5.1.2",
|
|
79
79
|
"@rsdoctor/rspack-plugin": "^1.2.3",
|
|
80
80
|
"@rspack/cli": "^1.5.8",
|
|
@@ -86,21 +86,21 @@
|
|
|
86
86
|
"@types/he": "^1.2.3",
|
|
87
87
|
"@types/insane": "^1.0.0",
|
|
88
88
|
"@types/mocha": "^10.0.10",
|
|
89
|
-
"@types/node": "^22.18.
|
|
89
|
+
"@types/node": "^22.18.12",
|
|
90
90
|
"@types/prismjs": "^1.26.5",
|
|
91
91
|
"@types/webpack-hot-middleware": "^2.25.11",
|
|
92
|
-
"@typescript-eslint/eslint-plugin": "^8.46.
|
|
92
|
+
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
|
93
93
|
"@wdio/cli": "^9.20.0",
|
|
94
94
|
"@wdio/globals": "^9.17.0",
|
|
95
95
|
"@wdio/local-runner": "^9.20.0",
|
|
96
96
|
"@wdio/mocha-framework": "^9.20.0",
|
|
97
97
|
"@wdio/spec-reporter": "^9.20.0",
|
|
98
|
-
"@zip.js/zip.js": "^2.8.
|
|
98
|
+
"@zip.js/zip.js": "^2.8.8",
|
|
99
99
|
"css-loader": "^7.1.2",
|
|
100
100
|
"css-minimizer-webpack-plugin": "^7.0.2",
|
|
101
101
|
"dexie": "^4.2.1",
|
|
102
102
|
"downshift": "^9.0.10",
|
|
103
|
-
"eslint": "^9.
|
|
103
|
+
"eslint": "^9.38.0",
|
|
104
104
|
"eslint-config-prettier": "^10.1.8",
|
|
105
105
|
"eslint-plugin-import": "^2.31.0",
|
|
106
106
|
"eslint-plugin-jsdoc": "^55.0.3",
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"sass-loader": "^16.0.5",
|
|
123
123
|
"spdy": "^4.0.2",
|
|
124
124
|
"stylelint": "^16.25.0",
|
|
125
|
-
"stylelint-config-recess-order": "^7.
|
|
125
|
+
"stylelint-config-recess-order": "^7.4.0",
|
|
126
126
|
"stylelint-config-standard": "^39.0.1",
|
|
127
127
|
"svgo-loader": "^4.0.0",
|
|
128
128
|
"typescript": "^5.9.3",
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns true or false based on whether doNotTrack is enabled. It also takes into account the
|
|
3
|
+
* anomalies, such as !bugzilla 887703, which effect versions of Fx 31 and lower. It also handles
|
|
4
|
+
* IE versions on Windows 7, 8 and 8.1, where the DNT implementation does not honor the spec.
|
|
5
|
+
* Based on https://github.com/mozmeao/dnt-helper/blob/main/src/mozilla-dnt-helper.js
|
|
6
|
+
* @see https://bugzilla.mozilla.org/show_bug.cgi?id=1217896 for more details
|
|
7
|
+
* @param {string} [dnt] - An optional mock doNotTrack string to ease unit testing.
|
|
8
|
+
* @param {string} [ua] - An optional mock userAgent string to ease unit testing.
|
|
9
|
+
* @returns {boolean} true if enabled else false
|
|
10
|
+
*/
|
|
11
|
+
export function dntEnabled(dnt, ua) {
|
|
12
|
+
// for old version of IE we need to use the msDoNotTrack property of navigator
|
|
13
|
+
// on newer versions, and newer platforms, this is doNotTrack but, on the window object
|
|
14
|
+
// Safari also exposes the property on the window object.
|
|
15
|
+
let dntStatus =
|
|
16
|
+
dnt ||
|
|
17
|
+
navigator.doNotTrack ||
|
|
18
|
+
// @ts-expect-error - non-standard property
|
|
19
|
+
globalThis.doNotTrack ||
|
|
20
|
+
// @ts-expect-error - non-standard property
|
|
21
|
+
navigator.msDoNotTrack;
|
|
22
|
+
const userAgent = ua || navigator.userAgent;
|
|
23
|
+
|
|
24
|
+
// List of Windows versions known to not implement DNT according to the standard.
|
|
25
|
+
const anomalousWinVersions = [
|
|
26
|
+
"Windows NT 6.1",
|
|
27
|
+
"Windows NT 6.2",
|
|
28
|
+
"Windows NT 6.3",
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
const fxMatch = userAgent.match(/Firefox\/(\d+)/);
|
|
32
|
+
const ieRegEx = /MSIE|Trident/i;
|
|
33
|
+
const isIE = ieRegEx.test(userAgent);
|
|
34
|
+
// Matches from Windows up to the first occurance of ; un-greedily
|
|
35
|
+
// http://www.regexr.com/3c2el
|
|
36
|
+
const platform = userAgent.match(/Windows.+?(?=;)/g);
|
|
37
|
+
|
|
38
|
+
// With old versions of IE, DNT did not exist so we simply return false;
|
|
39
|
+
if (isIE && typeof Array.prototype.indexOf !== "function") {
|
|
40
|
+
return false;
|
|
41
|
+
} else if (fxMatch && Number.parseInt(fxMatch[1] || "0", 10) < 32) {
|
|
42
|
+
// Can't say for sure if it is 1 or 0, due to Fx bug 887703
|
|
43
|
+
dntStatus = "Unspecified";
|
|
44
|
+
} else if (
|
|
45
|
+
isIE &&
|
|
46
|
+
platform &&
|
|
47
|
+
anomalousWinVersions.includes(platform.toString())
|
|
48
|
+
) {
|
|
49
|
+
// default is on, which does not honor the specification
|
|
50
|
+
dntStatus = "Unspecified";
|
|
51
|
+
} else {
|
|
52
|
+
// sets dntStatus to Disabled or Enabled based on the value returned by the browser.
|
|
53
|
+
// If dntStatus is undefined, it will be set to Unspecified
|
|
54
|
+
// @ts-expect-error - DNT status can be various types
|
|
55
|
+
dntStatus = { 0: "Disabled", 1: "Enabled" }[dntStatus] || "Unspecified";
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return dntStatus === "Enabled";
|
|
59
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const ACRONYMS = new Set(["MDN", "IX"]);
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Converts a kebab-case string to PascalCase,
|
|
5
|
+
* useful for converting a web component tag name to its
|
|
6
|
+
* associated class name.
|
|
7
|
+
*
|
|
8
|
+
* e.g. `mdn-custom-element` -> `MDNCustomElement`
|
|
9
|
+
*
|
|
10
|
+
* @param {string} name kebab-case string
|
|
11
|
+
* @returns {string} PascalCase string
|
|
12
|
+
*/
|
|
13
|
+
export function kebabToPascalCase(name) {
|
|
14
|
+
return name
|
|
15
|
+
.split("-")
|
|
16
|
+
.map((word) => {
|
|
17
|
+
if (ACRONYMS.has(word.toUpperCase())) {
|
|
18
|
+
return word.toUpperCase();
|
|
19
|
+
}
|
|
20
|
+
return word.charAt(0).toUpperCase() + word.slice(1);
|
|
21
|
+
})
|
|
22
|
+
.join("");
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Converts a camelCase or PascalCase string to kebab-case,
|
|
27
|
+
* useful for converting a web component class name to its
|
|
28
|
+
* associated tag name.
|
|
29
|
+
*
|
|
30
|
+
* e.g. `MDNCustomElement` -> `mdn-custom-element`
|
|
31
|
+
*
|
|
32
|
+
* @param {string} name camelCase or PascalCase string
|
|
33
|
+
* @returns {string} kebab-case string
|
|
34
|
+
*/
|
|
35
|
+
export function camelToKebabCase(name) {
|
|
36
|
+
return name
|
|
37
|
+
.replaceAll(/([a-z0-9])([A-Z])/g, "$1-$2")
|
|
38
|
+
.replaceAll(/([A-Z])([A-Z][a-z])/g, "$1-$2")
|
|
39
|
+
.toLowerCase();
|
|
40
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const FIRST_PARTY_DATA_OPT_OUT_COOKIE_NAME = "moz-1st-party-data-opt-out";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Checks if user has opted out of first-party data collection.
|
|
5
|
+
* @param {string} [cookie] - An optional mock cookie string to ease unit testing.
|
|
6
|
+
* @returns {boolean} True if user has opted out, false otherwise
|
|
7
|
+
*/
|
|
8
|
+
export function userIsOptedOut(cookie) {
|
|
9
|
+
return (cookie || document.cookie)
|
|
10
|
+
.split("; ")
|
|
11
|
+
.includes(`${FIRST_PARTY_DATA_OPT_OUT_COOKIE_NAME}=true`);
|
|
12
|
+
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { MISSING_DOCS } from "./constants.js";
|
|
2
|
-
|
|
3
|
-
for (const [locale, slugs] of Object.entries(MISSING_DOCS)) {
|
|
4
|
-
console.log(`\n=== ${locale} ===`);
|
|
5
|
-
|
|
6
|
-
const found = [];
|
|
7
|
-
let checkedCount = 0;
|
|
8
|
-
|
|
9
|
-
for (const slug of slugs) {
|
|
10
|
-
const url = `https://developer.mozilla.org/${locale}/docs/${slug}`;
|
|
11
|
-
process.stdout.write(`- ${slug} … `);
|
|
12
|
-
checkedCount++;
|
|
13
|
-
|
|
14
|
-
try {
|
|
15
|
-
const res = await fetch(url, { method: "HEAD" });
|
|
16
|
-
|
|
17
|
-
if (res.status === 200) {
|
|
18
|
-
console.log(`✅ (${res.status})`);
|
|
19
|
-
found.push(slug);
|
|
20
|
-
} else if (res.status === 404) {
|
|
21
|
-
console.log(`❌ (${res.status})`);
|
|
22
|
-
} else {
|
|
23
|
-
console.log(`⚠️ (${res.status})`);
|
|
24
|
-
}
|
|
25
|
-
} catch (error) {
|
|
26
|
-
console.log(`ERROR: ${error}`);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (found.length > 0) {
|
|
31
|
-
console.log(
|
|
32
|
-
`\n ${found.length} of ${checkedCount} slugs exist and can be removed from MISSING_DOCS:`,
|
|
33
|
-
);
|
|
34
|
-
for (const slug of found) {
|
|
35
|
-
console.log(` - ${slug}`);
|
|
36
|
-
}
|
|
37
|
-
} else {
|
|
38
|
-
console.log(
|
|
39
|
-
`\n All ${checkedCount} slugs are still missing for ${locale}`,
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
console.log(`\n=== Scan complete ===`);
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export const __webpack_id__="9914";export const __webpack_ids__=["9914"];export const __webpack_modules__={10632:function(e,t,s){s.d(t,{A:()=>l});var a=s(63819),n=s(31601),i=s.n(n),r=s(76314),o=s.n(r)()(i());o.push([e.id,"iframe{border:none;box-sizing:initial;height:100%;width:100%}",""]);let l=(0,a.AH)([o.toString()])},86129:function(e,t,s){s.r(t),s.d(t,{MDNPlayRunner:()=>MDNPlayRunner});var a=s(64889),n=s(63819),i=s(62963),r=s(70209),o=s(69392),l=s(93957),c=s(36728),d=s(45842),h=s(10632);let MDNPlayRunner=class MDNPlayRunner extends n.WF{static ssr=!1;static properties={code:{type:Object},defaults:{type:String},srcPrefix:{type:String,attribute:"src-prefix"},allow:{type:String},sandbox:{type:String},_src:{state:!0}};static styles=h.A;constructor(){super(),this.theme=new l.W(this),this.code=void 0,this.defaults=void 0,this.srcPrefix=void 0,this.allow=void 0,this.sandbox=void 0,this._subdomain=crypto.randomUUID(),this.ready=new Promise(e=>{this._resolveReady=()=>e(!0)}),this._src="about:blank"}_iframe=(0,o._)();_onMessage({data:{typ:e,prop:t,args:s,uuid:a},origin:n}){a||(a=new URL(n,"https://example.com").hostname.split(".")[0]),a===this._subdomain&&("console"===e?this.dispatchEvent(new CustomEvent("console",{bubbles:!0,composed:!0,detail:{prop:t,args:s}})):"ready"===e&&this._resolveReady())}_updateSrc=new a.YZ(this,{args:()=>[this.code,this.defaults,this.theme.value,this.srcPrefix],task:async([e,t,s,a],{signal:n})=>{if(e&&e.js&&e.wat){let t=await u(e.wat);e.js=e.js.replace("{%wasm-url%}",t)}let{state:i}=await (0,d.$)(JSON.stringify({html:e?.html||"",css:e?.css||"",js:e?.js||"",defaults:t,theme:s})),r=(a||"").replace(/\/$/,"");n.throwIfAborted();let o=new URL(`${r}/runner.html`,c.sR?location.origin.replace(c.I.toString(),c.mR.toString()):`${location.protocol}//${this._subdomain}.${c.tf}`);o.searchParams.set("uuid",this._subdomain),o.searchParams.set("state",i),this._src=o.href,this.dispatchEvent(new CustomEvent("mdn-play-runner-src",{bubbles:!0,composed:!0,detail:o.href}))}});connectedCallback(){super.connectedCallback(),this._onMessage=this._onMessage.bind(this),window.addEventListener("message",this._onMessage)}async postMessage(e){await this.ready,this._iframe.value?.contentWindow?.postMessage(e,"*")}render(){return(0,r.D)(this._src,(0,n.qy)`
|
|
2
|
-
<iframe
|
|
3
|
-
${(0,o.K)(this._iframe)}
|
|
4
|
-
src=${this._src}
|
|
5
|
-
title="runner"
|
|
6
|
-
allow=${(0,i.J)(this.allow)}
|
|
7
|
-
sandbox=${[...new Set(["allow-scripts","allow-same-origin","allow-forms",...this.sandbox?.split(" ")||[]])].join(" ")}
|
|
8
|
-
aria-live="polite"
|
|
9
|
-
></iframe>
|
|
10
|
-
`)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("message",this._onMessage)}};async function u(e){let{default:t,watify:a}=await s.e("7185").then(s.bind(s,12456));await t();let n=a(e);return`data:application/wasm;base64,${btoa(Array.from(n,e=>String.fromCodePoint(e)).join(""))}`}customElements.define("mdn-play-runner",MDNPlayRunner)},45842:function(e,t,s){async function a(e){let t=new Blob([e]),s=new CompressionStream("deflate-raw"),a=new Response(t.stream().pipeThrough(s)).arrayBuffer(),n=await a,i=[...new Uint8Array(await globalThis.crypto.subtle.digest("SHA-256",n))].slice(0,20).map(e=>e.toString(16).padStart(2,"0")).join("");return{state:btoa(Array.from(new Uint8Array(n),e=>String.fromCodePoint(e)).join("")),hash:i}}async function n(e){if(!e)return{state:null,hash:null};let t=function(e){let t=atob(e),s=t.length,a=new Uint8Array(s);for(let e=0;e<s;e++)a[e]=t.charCodeAt(e);return a.buffer}(e),s=[...new Uint8Array(await crypto.subtle.digest("SHA-256",t))].slice(0,20).map(e=>e.toString(16).padStart(2,"0")).join(""),a=new DecompressionStream("deflate-raw"),n=new Response(new Blob([t]).stream().pipeThrough(a)).arrayBuffer();return{state:new TextDecoder().decode(await n),hash:s}}s.d(t,{$:()=>a,p:()=>n})}};
|
|
11
|
-
//# sourceMappingURL=9914.251fe19f0038e97b.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"9914.251fe19f0038e97b.js","sources":["webpack://@mdn/fred/./components/play-runner/element.css","webpack://@mdn/fred/./components/play-runner/element.js","webpack://@mdn/fred/./components/playground/utils.js"],"sourcesContent":["import { css } from \"lit\";\n// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `iframe{border:none;box-sizing:initial;height:100%;width:100%}`, \"\"]);\n// Exports\nexport default css([___CSS_LOADER_EXPORT___.toString()]);\n","import { Task } from \"@lit/task\";\nimport { LitElement, html } from \"lit\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { keyed } from \"lit/directives/keyed.js\";\nimport { createRef, ref } from \"lit/directives/ref.js\";\n\nimport { ThemeController } from \"../color-theme/controller.js\";\nimport {\n PLAYGROUND_BASE_HOST,\n PLAYGROUND_LOCAL,\n PLAYGROUND_PORT,\n PORT,\n} from \"../env/index.js\";\nimport { compressAndBase64Encode } from \"../playground/utils.js\";\n\nimport styles from \"./element.css?lit\";\n\n/**\n * @import { RunnerDefaults } from \"./types.js\"\n * @import { VConsole } from \"../play-console/types.js\"\n * @import { Ref } from \"lit/directives/ref.js\";\n */\n\nexport class MDNPlayRunner extends LitElement {\n static ssr = false;\n\n static properties = {\n code: { type: Object },\n defaults: { type: String },\n srcPrefix: { type: String, attribute: \"src-prefix\" },\n allow: { type: String },\n sandbox: { type: String },\n _src: { state: true },\n };\n\n static styles = styles;\n\n constructor() {\n super();\n this.theme = new ThemeController(this);\n /** @type {Record<string, string> | undefined} */\n this.code = undefined;\n /** @type {RunnerDefaults | undefined} */\n this.defaults = undefined;\n /** @type {string | undefined} */\n this.srcPrefix = undefined;\n /** @type {string | undefined} */\n this.allow = undefined;\n /** @type {string | undefined} */\n this.sandbox = undefined;\n this._subdomain = crypto.randomUUID();\n /** @type {Promise<true>} */\n this.ready = new Promise((resolve) => {\n this._resolveReady = () => resolve(true);\n });\n this._src = \"about:blank\";\n }\n\n /** @type {Ref<HTMLIFrameElement>} */\n _iframe = createRef();\n\n /** @param {MessageEvent} e */\n _onMessage({ data: { typ, prop, args, uuid }, origin }) {\n if (!uuid) {\n uuid = new URL(origin, \"https://example.com\").hostname.split(\".\")[0];\n }\n if (uuid !== this._subdomain) {\n return;\n }\n if (typ === \"console\") {\n /** @type {VConsole} */\n const detail = { prop, args };\n this.dispatchEvent(\n new CustomEvent(\"console\", { bubbles: true, composed: true, detail }),\n );\n } else if (typ === \"ready\") {\n this._resolveReady();\n }\n }\n\n _updateSrc = new Task(this, {\n args: () =>\n /** @type {const} */ ([\n this.code,\n this.defaults,\n this.theme.value,\n this.srcPrefix,\n ]),\n task: async ([code, defaults, theme, srcPrefix], { signal }) => {\n if (code && code.js && code.wat) {\n const watUrl = await compileAndEncodeWatToDataUrl(code.wat);\n code.js = code.js.replace(\"{%wasm-url%}\", watUrl);\n }\n const { state } = await compressAndBase64Encode(\n JSON.stringify({\n html: code?.html || \"\",\n css: code?.css || \"\",\n js: code?.js || \"\",\n defaults: defaults,\n theme: theme,\n }),\n );\n const prefix = (srcPrefix || \"\").replace(/\\/$/, \"\");\n signal.throwIfAborted();\n // We're using a random subdomain for origin isolation.\n const url = new URL(\n `${prefix}/runner.html`,\n PLAYGROUND_LOCAL\n ? location.origin.replace(PORT.toString(), PLAYGROUND_PORT.toString())\n : `${location.protocol}//${this._subdomain}.${PLAYGROUND_BASE_HOST}`,\n );\n // pass the uuid for postMessage isolation\n url.searchParams.set(\"uuid\", this._subdomain);\n url.searchParams.set(\"state\", state);\n this._src = url.href;\n this.dispatchEvent(\n new CustomEvent(\"mdn-play-runner-src\", {\n bubbles: true,\n composed: true,\n detail: url.href,\n }),\n );\n },\n });\n\n connectedCallback() {\n super.connectedCallback();\n this._onMessage = this._onMessage.bind(this);\n window.addEventListener(\"message\", this._onMessage);\n }\n\n /** @param {any} message */\n async postMessage(message) {\n await this.ready;\n this._iframe.value?.contentWindow?.postMessage(message, \"*\");\n }\n\n render() {\n // use `keyed` to replace the iframe when src updates\n // this ensures we don't add to browser history\n return keyed(\n this._src,\n html`\n <iframe\n ${ref(this._iframe)}\n src=${this._src}\n title=\"runner\"\n allow=${ifDefined(this.allow)}\n sandbox=${[\n ...new Set([\n \"allow-scripts\",\n \"allow-same-origin\",\n \"allow-forms\",\n ...(this.sandbox?.split(\" \") || []),\n ]),\n ].join(\" \")}\n aria-live=\"polite\"\n ></iframe>\n `,\n );\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n window.removeEventListener(\"message\", this._onMessage);\n }\n}\n\n/**\n * Converts a Uint8Array to a base64 encoded string\n * @param {Uint8Array} bytes - The array of bytes to convert\n * @returns {string} The base64 encoded string representation of the input bytes\n */\nfunction uInt8ArrayToBase64(bytes) {\n const binString = Array.from(bytes, (byte) =>\n String.fromCodePoint(byte),\n ).join(\"\");\n return btoa(binString);\n}\n\n/**\n * compiles the wat code to wasm\n * @param {string} wat\n * @returns {Promise<string>} a data-url with the compiled wasm, base64 encoded\n */\nasync function compileAndEncodeWatToDataUrl(wat) {\n const { default: init, watify } = await import(\"@mdn/watify\");\n await init();\n const binary = watify(wat);\n const b64 = `data:application/wasm;base64,${uInt8ArrayToBase64(binary)}`;\n return b64;\n}\n\ncustomElements.define(\"mdn-play-runner\", MDNPlayRunner);\n","// import { PLAYGROUND_BASE_HOST } from \"../env\";\n\n// /**\n// * @import { EditorContent } from \"./types.js\";\n// */\n\n// /**\n// * @param {EditorContent} code\n// * @returns {string}\n// */\n// export function codeToMarkdown(code) {\n// const parts = [];\n// if (code.html) {\n// parts.push([\"```html\", code.html, \"```\"].join(\"\\n\"));\n// }\n// if (code.css) {\n// parts.push([\"```css\", code.css, \"```\"].join(\"\\n\"));\n// }\n// if (code.js) {\n// parts.push([\"```js\", code.js, \"```\"].join(\"\\n\"));\n// }\n// return parts.join(\"\\n\\n\");\n// }\n\n// /**\n// * @param {HTMLIFrameElement | null} iframe\n// * @param {EditorContent | null} editorContent\n// * @param {boolean} fullscreen\n// */\n// export async function initPlayIframe(\n// iframe,\n// editorContent,\n// fullscreen = false\n// ) {\n// if (!iframe || !editorContent) {\n// return;\n// }\n// const { state, hash } = await compressAndBase64Encode(\n// JSON.stringify(editorContent)\n// );\n// const path = iframe.getAttribute(\"data-live-path\");\n// const url = new URL(\n// `${path || \"\"}${path?.endsWith(\"/\") ? \"\" : \"/\"}runner.html`,\n// window.location.origin\n// );\n// if (!window.location.hostname.endsWith(\"localhost\")) {\n// const host = PLAYGROUND_BASE_HOST.startsWith(\"localhost\")\n// ? PLAYGROUND_BASE_HOST\n// : `${hash}.${PLAYGROUND_BASE_HOST}`;\n// url.port = \"\";\n// url.host = host;\n// }\n// url.search = \"\";\n// url.searchParams.set(\"state\", state);\n// iframe.src = url.href;\n// if (fullscreen) {\n// const urlWithoutHash = new URL(window.location.href);\n// urlWithoutHash.hash = \"\";\n// window.history.replaceState(null, \"\", urlWithoutHash);\n// window.location.href = url.href;\n// }\n// }\n\n/**\n * @param {ArrayBuffer} bytes\n */\nfunction bytesToBase64(bytes) {\n const binString = Array.from(new Uint8Array(bytes), (byte) =>\n String.fromCodePoint(byte),\n ).join(\"\");\n return btoa(binString);\n}\n\n/**\n * @param {string} inputString\n */\nexport async function compressAndBase64Encode(inputString) {\n const inputArray = new Blob([inputString]);\n\n const compressionStream = new CompressionStream(\"deflate-raw\");\n\n const compressedStream = new Response(\n inputArray.stream().pipeThrough(compressionStream),\n ).arrayBuffer();\n\n const compressed = await compressedStream;\n const hashBuffer = await globalThis.crypto.subtle.digest(\n \"SHA-256\",\n compressed,\n );\n const hashArray = [...new Uint8Array(hashBuffer)].slice(0, 20);\n const hash = hashArray.map((b) => b.toString(16).padStart(2, \"0\")).join(\"\");\n const state = bytesToBase64(compressed);\n\n return { state, hash };\n}\n\n/**\n * @param {string} base64\n * @returns {ArrayBuffer}\n */\nfunction base64ToBytes(base64) {\n const binString = atob(base64);\n const len = binString.length;\n const bytes = new Uint8Array(len);\n for (let i = 0; i < len; i++) {\n // eslint-disable-next-line unicorn/prefer-code-point\n bytes[i] = binString.charCodeAt(i);\n }\n return bytes.buffer;\n}\n\n/**\n * This is the browser version of `libs/play/index.js`. Keep in sync!\n * @param {string} base64String\n */\nexport async function decompressFromBase64(base64String) {\n if (!base64String) {\n return { state: null, hash: null };\n }\n const bytes = base64ToBytes(base64String);\n const hashBuffer = await crypto.subtle.digest(\"SHA-256\", bytes);\n const hashArray = [...new Uint8Array(hashBuffer)].slice(0, 20);\n const hash = hashArray.map((b) => b.toString(16).padStart(2, \"0\")).join(\"\");\n\n const decompressionStream = new DecompressionStream(\"deflate-raw\");\n\n const decompressedStream = new Response(\n new Blob([bytes]).stream().pipeThrough(decompressionStream),\n ).arrayBuffer();\n\n const state = new TextDecoder().decode(await decompressedStream);\n return { state, hash };\n}\n"],"names":["MDNPlayRunner","Object","String","crypto","Promise","URL","CustomEvent","JSON","location","window","i","Set","btoa","Array","customElements","Blob","CompressionStream","Response","Uint8Array","globalThis","atob","DecompressionStream","TextDecoder"],"mappings":"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"}
|
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
/*! For license information please see index.26176fe4ab13dce5.js.LICENSE.txt */
|
|
2
|
-
export const __webpack_id__="8410";export const __webpack_ids__=["8410"];export const __webpack_modules__={27887:function(e,t,n){n.d(t,{A:()=>h});var o=n(63819),a=n(31601),r=n.n(a),s=n(76314),i=n.n(s),l=n(4417),c=n.n(l),d=new n.U(n(34473)),u=i()(r()),m=c()(d);u.push([e.id,`*,:after,:before{box-sizing:border-box}dialog{border:0;padding:0}@media (width > 1006px){dialog{background-color:var(--color-background-primary);border:1px solid var(--color-border-primary);border-radius:.5rem;font-size:var(--font-size-large);margin:calc(var(--sticky-header-height) + 1rem) auto 1rem;max-height:calc(100% - var(--sticky-header-height) - 2rem);width:calc(var(--layout-content-max) + 1rem)}dialog::backdrop{--csstools-light-dark-toggle-dee8eb9e-0:var(--csstools-color-scheme--light) var(--color-black-alpha-75);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background-color:var(--csstools-light-dark-toggle-dee8eb9e-0,var(--color-white-alpha-75))}@supports (color:light-dark(red,red)){dialog::backdrop{background-color:light-dark(var(--color-white-alpha-75),var(--color-black-alpha-75))}}}@media (width <= 1006px){dialog{font-size:var(--font-size-normal);height:100%;margin:0;max-height:100%;max-width:100%;width:100%}}dialog[open]{display:grid;grid-template-areas:"search close" "progress progress" "results results";grid-template-columns:1fr min-content;grid-template-rows:var(--navigation-height) min-content min-content}progress{grid-area:progress;margin:0 1rem .5rem}@media (width <= 1006px){progress{margin-inline:.3rem}}.close{font-size:1.37rem;grid-area:close}@media (width > 1006px){.close{display:none}}form{display:grid;gap:.5rem;grid-area:search;grid-template-columns:min-content 1fr;padding:1rem;place-items:center}@media (width <= 1006px){form{align-self:center;background-color:var(--color-background-primary);border:1px solid var(--color-border-primary);border-radius:.5rem;margin-left:.3rem;padding:.5rem}}form:before{background-color:var(--color-border-secondary);content:"";height:1em;-webkit-mask-image:url(${m});mask-image:url(${m});-webkit-mask-size:contain;mask-size:contain;width:1em}input{background-color:initial;border:none;font-size:inherit;margin:0;outline:none;padding:0;width:100%}input::placeholder{color:var(--color-text-secondary)}ul{grid-area:results;margin:0;overflow:auto;overscroll-behavior:contain;padding:0}ul:has(li){border-top:1px solid var(--color-border-primary)}li[data-selected]{background:var(--color-background-blue);border-color:var(--color-blue-50)}li{border-inline-start:2px solid #0000;list-style-type:none}li:not([data-selected]):hover{background-color:var(--color-background-secondary)}li>*{padding:.5rem 1.5rem;width:100%}a{color:var(--color-link-normal);display:grid;-webkit-text-decoration:none;text-decoration:none}a:visited{color:var(--color-link-visited)}.slug{color:var(--color-text-secondary);font-size:var(--font-size-small)}mark{background-color:var(--color-background-yellow);color:var(--color-text-primary)}`,""]);let h=(0,o.AH)([u.toString()])},37940:function(e,t,n){n.d(t,{A:()=>a});var o=n(63819);let a=(0,o.JW)`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="M18 6 6 18M6 6l12 12"/></svg>`},47479:function(e,t,n){var o={"./code-example/element.js":["69208","3945","9963","7627","1595","993","3187"],"./dropdown/element.js":["1783","220","7948"],"./live-sample-result/element.js":["4225","3945","8427","9963","9478","9914","7627","6480"],"./observatory-tests-and-scores/element.js":["37538","1231"],"./play-runner/element.js":["86129","3945","9478","9914","9696"],"./search-button/element.js":["69817","2002"],"./survey/element.js":["6674","3945","9963","5124","3279"],"./ix-tab-wrapper/element.js":["56259","7072"],"./placement-sidebar/element.js":["43236","3945","8427","288","8797","2885","3733"],"./placement-hp-main/element.js":["9714","3945","8427","288","8797","2885","8607"],"./record-visit/element.js":["71373","3330","9566"],"./toggle-sidebar/element.js":["74540","9963","2860"],"./user-menu/element.js":["5265","9963","5124","1274"],"./interactive-example/element.js":["51851","3945","9379","9804","490","5745","2192","2936","6372","5123","9378","9963","9478","9914","3292","9679","7627","6536","1595","4091","993","7072","3122","6040"],"./copy-button/element.js":["2406","9963","1595","806"],"./observatory-comparison-table/element.js":["30077","7221","606"],"./sidebar-filter/element.js":["525","5534"],"./issues-table/element.js":["91423","3092"],"./scrim-inline/element.js":["1826","8427","2319"],"./switch/element.js":["89134","1363"],"./collection-save-button/element.js":["30931","9963","2190","1648"],"./contributor-list/element.js":["60642","479"],"./button/element.js":["99638","9963","5568"],"./homepage-search/element.js":["75509","1158"],"./modal/element.js":["53343","9963","2190"],"./color-theme/element.js":["23485","220","3200"],"./about-team-member/element.js":["7260","4781"],"./content-feedback/element.js":["21672","9963","603"],"./play-console/element.js":["75143","3292"],"./ix-tab/element.js":["11865","4091","3122"],"./observatory-header-link/element.js":["82767","7221","6452"],"./curriculum-tabs/element.js":["85804","3213"],"./placement-bottom/element.js":["64047","3945","8427","288","8797","2885","8036"],"./image-history/element.js":["69954","9935"],"./not-found/element.js":["11942","495","667"],"./placement-note/element.js":["55772","8797"],"./compat-table-lazy/element.js":["18526","5124","2308","451"],"./site-search/element.js":["30757","9963","4071"],"./placement-no/element.js":["10787","288"],"./play-controller/element.js":["99723","6536"],"./placement-top/element.js":["72135","3945","8427","288","8797","2885","3132"],"./observatory-form/element.js":["92691","3945","9963","8998","370"],"./observatory-results/element.js":["85324","9963","7221","220","8998","606","5019","6452","14","9837"],"./about-tabs/element.js":["49410","9519"],"./observatory-human-duration/element.js":["22061","7221","14"],"./playground/element.js":["75259","3945","9379","9804","490","5745","2192","2936","6372","5123","9963","9478","9914","3292","9679","6536","2190","9784"],"./ix-tab-panel/element.js":["20358","4091"],"./play-editor/element.js":["20002","9379","9804","490","5745","2192","2936","6372","5123","9478","9679"],"./themed-image/element.js":["10421","7462"],"./writer-open-editor/element.js":["91398","9963","8793"],"./progress-bar/element.js":["73589","8998"],"./compat-table/element.js":["30191","5124","2308"],"./login-button/element.js":["730","9963","8093"],"./observatory-rescan-button/element.js":["81512","9963","5019","7789"],"./recently-visited/element.js":["5877","3330","486"],"./language-always-redirect-button/element.js":["10860","4334","7741"],"./language-switcher/element.js":["82102","220","1363","495","4334","6465"],"./search-modal/element.js":["49818"],"./writer-reload/element.js":["7589","5446"]};function a(e){if(!n.o(o,e))return Promise.resolve().then(function(){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=o[e],a=t[0];return Promise.all(t.slice(1).map(n.e)).then(function(){return n(a)})}a.keys=()=>Object.keys(o),a.id=47479,e.exports=a},34473:function(e,t,n){e.exports=n.p+"search.5dd31cbeea7d1af9.svg"},33098:function(){try{let t=document.querySelector(".baseline-indicator");function e(e){e?localStorage.setItem("baseline-indicator","open"):localStorage.removeItem("baseline-indicator")}t instanceof HTMLDetailsElement&&(t.addEventListener("toggle",()=>{e(t.open)}),e(t.open))}catch(e){console.warn("Unable to attach to baseline indicator",e)}},36728:function(e,t,n){n.d(t,{i7:()=>f,iW:()=>y,tf:()=>l,I:()=>d,mR:()=>u,_0:()=>p,Q:()=>v,sR:()=>c,vQ:()=>m,kv:()=>h,g_:()=>g,QD:()=>b});let o=[],a=r("RUNTIME_ENV",!0);function r(e,t,n){try{return!!JSON.parse(i(e,n)||JSON.stringify(t))}catch{return t}}function s(e,t,n){let o=i(e,n),a=o?Number.parseInt(o,10):t;return Number.isNaN(a)?t:a}function i(e,t={}){let{runtime:n}={runtime:!1,...t},r=`FRED_${e}`;return n&&a?(o.push(r),globalThis.process?.env[r]||i(e)):({FRED_RUNTIME_ENV:"true",FRED_PLAYGROUND_LOCAL:"false",FRED_LEGACY:"true"})[r]}let l=i("PLAYGROUND_BASE_HOST",void 0)||"mdnplay.dev",c=r("PLAYGROUND_LOCAL",!1,{runtime:!0}),d=s("PORT",3e3,{runtime:!0}),u=s("PLAYGROUND_PORT",3001,{runtime:!0}),m=i("FXA_SIGNIN_URL",void 0)||"/users/fxa/login/authenticate/",h=i("FXA_SIGNOUT_URL",void 0)||"/users/fxa/login/logout/",p=r("GLEAN_ENABLED",!1),g=i("GLEAN_CHANNEL",void 0)||"dev",f=r("GLEAN_DEBUG",!1);r("ROBOTS_GLOBAL_ALLOW",!0);let b=r("WRITER_MODE",!1,{runtime:!0}),y=i("BCD_BASE_URL",void 0)||"https://bcd.developer.mozilla.org",v=i("OBSERVATORY_API_URL",void 0)||"https://observatory-api.mdn.mozilla.net"},99217:function(){let e=document.querySelector('[aria-controls="navigation__popup"]'),t=document.querySelector(".navigation");e instanceof HTMLElement&&t instanceof HTMLElement&&e.addEventListener("click",()=>{let n=("true"!==t.dataset.open).toString();t.dataset.open=n,e.setAttribute("aria-expanded",n)})},49818:function(e,t,n){n.r(t),n.d(t,{MDNSearchModal:()=>MDNSearchModal,splitQuery:()=>d});var o=n(64889),a=n(63819),r=n(86484),s=n(39943),i=n(90528),l=n(37940),c=n(27887);let MDNSearchModal=class MDNSearchModal extends(0,r.J)(a.WF){static ssr=!1;static styles=c.A;static properties={_index:{state:!0},_query:{state:!0},_selected:{state:!0},_shiftFocus:{state:!0}};constructor(){super(),this._index=void 0,this._query="",this._selected=0,this._shiftFocus=!1,this._hasEngaged=!1}async _loadIndex(){this._index||(this._index=this._fetchIndex())}async _fetchIndex(){let e=await fetch(`/${this.locale}/search-index.json`),t=await e.json();return{flex:t.map(({title:e,url:t},n)=>({index:n,title:e.toLowerCase(),slugTail:t.split("/").pop()?.toLowerCase()||""})),items:t}}showModal(){this._loadIndex(),this.shadowRoot?.querySelector("dialog")?.showModal(),this.shadowRoot?.querySelector("input")?.select()}_input({inputType:e,target:t}){t instanceof HTMLInputElement&&(this._query=t.value,!this._hasEngaged&&e.startsWith("insert")&&(this._hasEngaged=!0,(0,s.w)(`quick-search-change: ${"insertFromPaste"===e?"paste":"type"}`)))}_keydown(e){switch(e.key){case"ArrowUp":e.preventDefault(),this._select(this._selected-1);break;case"ArrowDown":e.preventDefault(),this._select(this._selected+1);break;case"Enter":{let{ctrlKey:t,shiftKey:n,altKey:o,metaKey:a}=e,r=this._getSelectedItem();r instanceof HTMLElement&&(e.preventDefault(),r.dispatchEvent(new MouseEvent("click",{bubbles:!0,composed:!0,ctrlKey:t,shiftKey:n,altKey:o,metaKey:a})));break}default:return}}_getSelectedItem(){return this.shadowRoot?.querySelector("[data-selected] a")??null}_select(e){let t=(this._queryIndex.value?.length||0)+1,n=e%t;this._selected=n<0?t+e:n,setTimeout(()=>{let e=this._getSelectedItem();e instanceof HTMLElement&&e.scrollIntoView({behavior:"smooth",block:"nearest"})},0)}_submit(e){e.preventDefault();let t=this._getSelectedItem();t instanceof HTMLElement&&t.click()}_focus({target:e}){if(e instanceof HTMLElement){let t=e.closest("[data-result]");if(t instanceof HTMLElement){let e=Number.parseInt(t.dataset.result||"NaN",10);Number.isNaN(e)||(this._selected=e,this._shiftFocus=!0)}else this._shiftFocus=!1}}_globalKeydown(e){let t=e.composedPath()?.[0]||e.target;if(t instanceof HTMLElement&&(["TEXTAREA","INPUT"].includes(t.tagName)||t.isContentEditable))return;let n=globalThis.getSelection()?.toString(),o=e.key,a=e.ctrlKey||e.metaKey,r="/"===o&&!a,i="k"===o&&a&&!e.shiftKey;(r||i)&&(e.preventDefault(),(0,s.w)(`quick-search-open: keyboard -> ${r?"slash":"ctrl-k"}`),this.showModal(),n&&(this._query=n,this._hasEngaged||(this._hasEngaged=!0,(0,s.w)("quick-search-change: selection"))))}_queryIndex=new o.YZ(this,{args:()=>[this._index,this._query],task:async([e,t])=>{if(e&&t){var n,o;let a,r;return n=t,o=await e,a=n.toLowerCase().trim(),r=d(n),o.flex.filter(({title:e})=>r.every(t=>e.includes(t))).map(({index:e,title:t,slugTail:n})=>[Number([t,n].includes(a)),e]).sort(([e],[t])=>t-e).map(([e,t])=>t).slice(0,10).map(e=>e&&(o.items||[])[e]).filter(Boolean)}}});_close(){this.shadowRoot?.querySelector("dialog")?.close()}connectedCallback(){super.connectedCallback(),this._globalKeydown=this._globalKeydown.bind(this),document.addEventListener("keydown",this._globalKeydown),this._loadIndex=this._loadIndex.bind(this),this.renderRoot.addEventListener("mouseover",this._loadIndex)}disconnectedCallback(){super.disconnectedCallback(),this.renderRoot.removeEventListener("mouseover",this._loadIndex),document.removeEventListener("keydown",this._globalKeydown)}_renderLoadingSearchIndex(){return(0,a.qy)`<progress
|
|
3
|
-
aria-label=${this.l10n`Loading search index…`}
|
|
4
|
-
></progress>`}render(){let e=this._queryIndex.value?.length||0,t=this._query?`/${this.locale}/search?${new URLSearchParams({q:this._query})}`:null;return(0,a.qy)`
|
|
5
|
-
<dialog @keydown=${this._keydown} @focusin=${this._focus} closedby="any">
|
|
6
|
-
<form
|
|
7
|
-
method="get"
|
|
8
|
-
action=${`/${this.locale}/search`}
|
|
9
|
-
@submit=${this._submit}
|
|
10
|
-
>
|
|
11
|
-
<input
|
|
12
|
-
type="search"
|
|
13
|
-
name="q"
|
|
14
|
-
.value=${this._query}
|
|
15
|
-
autofocus
|
|
16
|
-
@input=${this._input}
|
|
17
|
-
placeholder=${this.l10n`Search`}
|
|
18
|
-
aria-label=${this.l10n`Search`}
|
|
19
|
-
/>
|
|
20
|
-
</form>
|
|
21
|
-
<mdn-button
|
|
22
|
-
class="close"
|
|
23
|
-
variant="plain"
|
|
24
|
-
icon-only
|
|
25
|
-
.icon=${l.A}
|
|
26
|
-
@click=${this._close}
|
|
27
|
-
>${this.l10n`Exit search`}</mdn-button
|
|
28
|
-
>
|
|
29
|
-
${this._queryIndex.render({initial:this._renderLoadingSearchIndex.bind(this),pending:this._renderLoadingSearchIndex.bind(this)})}
|
|
30
|
-
<ul>
|
|
31
|
-
${this._queryIndex.render({complete:e=>e?.map(({title:e,url:t},n)=>{var o;let r,s;return(0,a.qy)`
|
|
32
|
-
<li ?data-selected=${this._selected===n} data-result=${n}>
|
|
33
|
-
<a
|
|
34
|
-
href=${t}
|
|
35
|
-
data-glean-id=${`quick-search: results[${1+n}] -> ${this._query} -> ${t}`}
|
|
36
|
-
><span class="slug"
|
|
37
|
-
>${(0,i.o)(t,this.locale)}</span
|
|
38
|
-
>
|
|
39
|
-
<span class="title"
|
|
40
|
-
>${o=e,s=(r=d(this._query)).map(e=>e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)).map(e=>`(${e})`).join("|"),o.split(RegExp(s,"gi")).filter(Boolean).map(e=>r.includes(e.toLowerCase())?(0,a.qy)`<mark>${e}</mark>`:e)}</span
|
|
41
|
-
></a
|
|
42
|
-
>
|
|
43
|
-
</li>
|
|
44
|
-
`})})}
|
|
45
|
-
${t?(0,a.qy)`<li
|
|
46
|
-
?data-selected=${this._selected===e}
|
|
47
|
-
data-result=${e}
|
|
48
|
-
>
|
|
49
|
-
<a
|
|
50
|
-
href=${t}
|
|
51
|
-
data-glean-id=${`quick-search: site-search -> ${this._query}`}
|
|
52
|
-
><span class="title"
|
|
53
|
-
>${this.l10n.raw({id:"search-modal-site-search",args:{query:this._query},elements:{query:{tag:"code"}}})}</span
|
|
54
|
-
></a
|
|
55
|
-
>
|
|
56
|
-
</li>`:a.s6}
|
|
57
|
-
</ul>
|
|
58
|
-
</dialog>
|
|
59
|
-
`}updated(){if(this._shiftFocus){let e=this._getSelectedItem();e instanceof HTMLElement&&e.focus()}}};function d(e){return(e=e.trim().toLowerCase()).startsWith(".")||e.endsWith(".")?e.split(/[ ,]+/):e.split(/[ ,.]+/)}customElements.define("mdn-search-modal",MDNSearchModal)},93526:function(e,t,n){let o;n.d(t,{L:()=>i});var a=n(36728);let r={country:"United States",country_iso:"US"},s={username:null,isAuthenticated:!1,avatarUrl:null,isSubscriber:!1,subscriptionType:null,email:null,geo:r,settings:null};function i(){return a.QD?new Promise(()=>{}):(o||(o=l().catch(e=>(console.error(e),s))),o)}async function l(){let e=await fetch("/api/v1/whoami");if(!e.ok)throw Error(e.statusText);try{let t=await e.json(),n=t?.settings?{aiHelpHistory:"boolean"==typeof t.settings?.ai_help_history?t.settings.ai_help_history:null,noAds:t.settings?.no_ads??null}:s.settings;return c.noAds=n?.noAds||!1,{username:t.username??s.username,isAuthenticated:t.is_authenticated??s.isAuthenticated,avatarUrl:t.avatar_url??s.avatarUrl,isSubscriber:t.is_subscriber??s.isSubscriber,subscriptionType:"core"===t.subscription_type?"mdn_core":t.subscription_type??s.subscriptionType,email:t.email??s.email,geo:{country:(t.geo&&t.geo.country)??r.country,country_iso:(t.geo&&t.geo.country_iso)??r.country_iso},settings:n}}catch{throw Error(e.statusText)}}let c={set noAds(value){value?globalThis.localStorage.setItem("nop","yes"):globalThis.localStorage.removeItem("nop")},get noAds(){return globalThis.localStorage?.getItem?.("nop")==="yes"}}},31051:function(e,t,n){n.a(e,async function(e,t){try{n(4591),n(68069),n(73013),n(23929),n(64989),n(33098),n(64531),n(99217),n(41600);var o=n(42732),a=n(43531);n(7461);var r=n(99229),s=e([o,a,r]);[o,a,r]=s.then?(await s)():s,t()}catch(e){t(e)}})},42732:function(e,t,n){n.a(e,async function(e,t){try{for(let e of document.querySelectorAll('div.code-example pre:not(.hidden):not([class*="live-sample"]):not([class*="interactive-example"])')){let{upgradePre:t}=await Promise.all([n.e("3945"),n.e("9963"),n.e("7627"),n.e("1595"),n.e("993"),n.e("3187")]).then(n.bind(n,69208));t(e)}t()}catch(e){t(e)}},1)},23929:function(){"closedBy"in HTMLDialogElement.prototype||addEventListener("click",e=>{let t=e.composedPath()[0];if(t instanceof HTMLDialogElement&&"any"===t.getAttribute("closedby")){let n=t.getBoundingClientRect(),{clientX:o,clientY:a}=e;n.top<=a&&a<=n.bottom&&n.left<=o&&o<=n.right||t.close()}})},73013:function(e,t,n){var o=n(32890),a=n(36728),r=n(39943);let s=!document.cookie.split("; ").includes("moz-1st-party-data-opt-out=true")&&a._0;a.i7&&(o.Ay.setDebugViewTag("mdn-dev"),o.Ay.setLogPings(!0)),o.Ay.initialize("mdn-fred",s,{enableAutoPageLoadEvents:!0,enableAutoElementClickEvents:!0,channel:a.g_}),document.addEventListener("click",e=>{let t=e.composedPath()?.[0];if(t!==e.target&&t instanceof Element){let e=t.closest("[data-glean-id]");if(e instanceof HTMLElement){let t=e.dataset.gleanId;t&&(0,r.w)(t)}}let n=t??e.target;if(n instanceof Element){let e=n.closest("a");e instanceof HTMLAnchorElement&&e.href&&e.origin&&e.origin!==document.location.origin&&(0,r.w)(`external-link: ${e.href}`)}})},43531:function(e,t,n){n.a(e,async function(e,t){try{for(let e of document.querySelectorAll("iframe[data-live-id]"))if(e instanceof HTMLIFrameElement){let{liveId:t,livePath:o}=e.dataset;if(t){let a={},r=[],s=t.replaceAll(".",String.raw`\.`);for(let e of document.querySelectorAll(`.live-sample___${s}, .live-sample---${s}`)){let{MDNCodeExample:t,upgradePre:o}=await Promise.all([n.e("3945"),n.e("9963"),n.e("7627"),n.e("1595"),n.e("993"),n.e("3187")]).then(n.bind(n,69208)),s=e instanceof t?e:o(e);if(s){r.push(s);let{language:e,code:t}=s;a[e]?a[e]+=t:a[e]=t}}await Promise.all([n.e("3945"),n.e("8427"),n.e("9963"),n.e("9478"),n.e("9914"),n.e("7627"),n.e("6480")]).then(n.bind(n,4225));let i=document.createElement("mdn-live-sample-result");for(let n of(i.liveId=t,i.code=a,i.srcPrefix=o,i.allow=e.allow||void 0,i.sandbox=e.sandbox.toString(),i.height=e.height,e.closest(".code-example")?.replaceWith(i),r))n.liveSample||=i}}t()}catch(e){t(e)}},1)},64989:function(e,t,n){let o=new Set;for(let e of document.querySelectorAll("*")){let t=e.tagName.toLowerCase();if(t.startsWith("mdn-")||"interactive-example"===t){let e=t.replace("mdn-","");o.has(e)||(o.add(e),n(47479)(`./${e}/element.js`).catch(t=>{console.error(`couldn't load code for <${e}>: does the element's code not match the naming schema?`,t)}))}}},64531:function(){let e=document.querySelector(".left-sidebar"),t=e?.querySelector('[aria-current="page"]');e&&t instanceof HTMLElement&&e.scrollTo({top:t.offsetTop-window.innerHeight/4})},7461:function(e,t,n){var o=n(49818);let a=document.querySelector('.a11y-menu a[href="#search"]');if(a instanceof HTMLAnchorElement){let e=document.querySelector("#search");e instanceof o.MDNSearchModal?a.addEventListener("click",t=>{let{target:n}=t;n instanceof HTMLElement&&(n.blur(),t.preventDefault()),e.showModal()}):(console.error("MDNSearchModal not found!"),a.hidden=!0)}},41600:function(){for(let e of document.querySelectorAll(".generic-toc, .reference-toc, .document-toc, .blog-toc"))e instanceof HTMLElement&&function(e){let t=[...e.querySelectorAll("a")],n=new Map;for(let e of t.reverse()){let t=document.querySelector(`[id="${decodeURIComponent(e.hash).slice(1)}"]`);if(!t)continue;let o=t.closest("section");for(;o&&o instanceof HTMLElement&&!n.has(o);)n.set(o,e),o=o.nextElementSibling}let o=new WeakMap,a=new Set,r={threshold:0},s=document.querySelector("header");s instanceof HTMLElement&&(r.rootMargin=`-${s.clientHeight}px 0px 0px 0px`);let i=new IntersectionObserver(e=>{for(let{target:t,isIntersecting:r}of e){if(!(t instanceof HTMLElement))continue;if(!a.has(t))if(!r)continue;else a.add(t);let e=n.get(t);if(!e)continue;let s=(o.get(e)??0)+(r?1:-1);e.ariaCurrent=s>0?"true":null,o.set(e,s)}},r);for(let e of n.keys())i.observe(e)}(e)},99229:function(e,t,n){n.a(e,async function(e,t){try{var o=n(93526);try{let e=await (0,o.L)(),t=new Date(localStorage.getItem("next-ping")||0);if(navigator.sendBeacon&&e.isAuthenticated&&t<new Date){let e=new URLSearchParams;navigator.sendBeacon("/api/v1/ping",e);let t=new Date;t.setUTCDate(t.getUTCDate()+1),t.setUTCHours(0),t.setUTCMinutes(0),t.setUTCSeconds(0),t.setUTCMilliseconds(0),localStorage.setItem("next-ping",t.toISOString())}}catch(e){console.error("Failed to send ping",e)}t()}catch(e){t(e)}},1)},86484:function(e,t,n){n.d(t,{J:()=>m});var o=n(24909),a=n(81233),r=n(58055);let s=`# TODO Use comments, see: https://firefox-source-docs.mozilla.org/l10n/fluent/review.html#comments
|
|
60
|
-
# TODO Consider using terms, see: https://firefox-source-docs.mozilla.org/l10n/fluent/review.html#terms and https://projectfluent.org/fluent/guide/references.html#message-references
|
|
61
|
-
|
|
62
|
-
article-footer-last-modified = This page was last modified on <time data-l10n-name="date">{ $date }</time> by <a data-l10n-name="contributors">MDN contributors</a>.
|
|
63
|
-
article-footer-source-title = Folder: { $folder } (Opens in a new tab)
|
|
64
|
-
|
|
65
|
-
baseline-asterisk = Some parts of this feature may have varying levels of support.
|
|
66
|
-
baseline-high-extra = This feature is well established and works across many devices and browser versions. It’s been available across browsers since { $date }.
|
|
67
|
-
baseline-low-extra = Since { $date }, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
|
|
68
|
-
baseline-not-extra = This feature is not Baseline because it does not work in some of the most widely-used browsers.
|
|
69
|
-
baseline-supported-in = Supported in { $browsers }
|
|
70
|
-
baseline-unsupported-in = Not widely supported in { $browsers }
|
|
71
|
-
baseline-supported-and-unsupported-in = Supported in { $supported }, but not widely supported in { $unsupported }
|
|
72
|
-
|
|
73
|
-
homepage-hero-title = Resources for Developers,<br> by Developers
|
|
74
|
-
homepage-hero-description = Documenting <a data-l10n-name="css">CSS</a>, <a data-l10n-name="html">HTML</a>, and <a data-l10n-name="js">JavaScript</a>, since 2005.
|
|
75
|
-
|
|
76
|
-
not-found-title = Page not found
|
|
77
|
-
not-found-description = Sorry, the page <code data-l10n-name="url">{ $url }</code> could not be found.
|
|
78
|
-
not-found-fallback-english = <strong data-l10n-name="strong">Good news:</strong> The page you requested exists in <em data-l10n-name="em">English</em>.
|
|
79
|
-
not-found-fallback-search = The page you requested doesn't exist, but you could try a site search for:
|
|
80
|
-
not-found-back = Go back to the home page
|
|
81
|
-
|
|
82
|
-
reference-toc-header = In this article
|
|
83
|
-
|
|
84
|
-
footer-mofo = Visit <a data-l10n-name="moco">Mozilla Corporation’s</a> not-for-profit parent, the <a data-l10n-name="mofo">Mozilla Foundation</a>.
|
|
85
|
-
footer-copyright = Portions of this content are \xa91998–{ $year } by individual mozilla.org contributors. Content available under <a data-l10n-name="cc">a Creative Commons license</a>.
|
|
86
|
-
|
|
87
|
-
search-modal-site-search = Site search for <em>{ $query }</em>
|
|
88
|
-
|
|
89
|
-
site-search-search-stats = Found { $results } documents.
|
|
90
|
-
site-search-suggestion-matches = { $relation ->
|
|
91
|
-
[gt] more than { $matches ->
|
|
92
|
-
[one] { $matches } match
|
|
93
|
-
*[other] { $matches } matches
|
|
94
|
-
}
|
|
95
|
-
*[eq] { $matches ->
|
|
96
|
-
[one] { $matches } match
|
|
97
|
-
*[other] { $matches } matches
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
site-search-suggestions-text = Did you mean:
|
|
101
|
-
|
|
102
|
-
blog-time-to-read = { $minutes ->
|
|
103
|
-
[one] { $minutes } minute read
|
|
104
|
-
*[other] { $minutes } minutes read
|
|
105
|
-
}
|
|
106
|
-
blog-post-not-found = Blog post not found.
|
|
107
|
-
|
|
108
|
-
blog-previous = Previous post
|
|
109
|
-
blog-next = Next post
|
|
110
|
-
|
|
111
|
-
-brand-name-obs = HTTP Observatory
|
|
112
|
-
obs-report = Report
|
|
113
|
-
obs-title = { -brand-name-obs }
|
|
114
|
-
obs-landing-intro = Launched in 2016, the { -brand-name-obs } enhances web security by analyzing compliance with best security practices. It has provided insights to over 6.9 million websites through 47 million scans.
|
|
115
|
-
obs-assessment = Developed by Mozilla, the { -brand-name-obs } performs an in-depth assessment of a site’s HTTP headers and other key security configurations.
|
|
116
|
-
obs-scanning = Its automated scanning process provides developers and website administrators with detailed, actionable feedback, focusing on identifying and addressing potential security vulnerabilities.
|
|
117
|
-
obs-security = The tool is instrumental in helping developers and website administrators strengthen their sites against common security threats in a constantly advancing digital environment.
|
|
118
|
-
obs-mdn = The { -brand-name-obs } provides effective security insights, guided by Mozilla's expertise and commitment to a safer and more secure internet and based on well-established trends and guidelines.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
compat-loading = Loading…
|
|
122
|
-
|
|
123
|
-
compat-browser-version-date = { $browser } { $version } – Release date: { $date }
|
|
124
|
-
compat-browser-version-released = Release date: { $date }
|
|
125
|
-
|
|
126
|
-
compat-link-report-issue = Report problems with this compatibility data
|
|
127
|
-
compat-link-report-issue-title = Report an issue with this compatibility data
|
|
128
|
-
compat-link-report-missing-title = Report missing compatibility data
|
|
129
|
-
compat-link-report-missing = Report this issue
|
|
130
|
-
compat-link-source = View data on GitHub
|
|
131
|
-
compat-link-source-title = File: { $filename }
|
|
132
|
-
|
|
133
|
-
compat-deprecated = Deprecated
|
|
134
|
-
compat-experimental = Experimental
|
|
135
|
-
compat-nonstandard = Non-standard
|
|
136
|
-
compat-no = No
|
|
137
|
-
|
|
138
|
-
compat-support-full = Full support
|
|
139
|
-
compat-support-partial = Partial support
|
|
140
|
-
compat-support-no = No support
|
|
141
|
-
compat-support-unknown = Support unknown
|
|
142
|
-
compat-support-preview = Preview browser support
|
|
143
|
-
compat-support-prefix = Implemented with the vendor prefix: { $prefix }
|
|
144
|
-
compat-support-altname = Alternate name: { $altname }
|
|
145
|
-
compat-support-removed = Removed in { $version } and later
|
|
146
|
-
compat-support-see-impl-url = See <a data-l10n-name="impl_url">{ $label }</a>
|
|
147
|
-
compat-support-flags =
|
|
148
|
-
{ NUMBER($has_added) ->
|
|
149
|
-
[one] From version { $version_added }
|
|
150
|
-
*[other] {""}
|
|
151
|
-
}{ $has_last ->
|
|
152
|
-
[one] { NUMBER($has_added) ->
|
|
153
|
-
*[zero] Until { $versionLast } users
|
|
154
|
-
[one] {" "}until { $versionLast } users
|
|
155
|
-
}
|
|
156
|
-
*[zero] { NUMBER($has_added) ->
|
|
157
|
-
*[zero] Users
|
|
158
|
-
[one] {" "}users
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
{" "}must explicitly set the <code data-l10n-name="name">{ $flag_name }</code>{" "}
|
|
162
|
-
{ $flag_type ->
|
|
163
|
-
*[preference] preference
|
|
164
|
-
[runtime_flag] runtime flag
|
|
165
|
-
}{ NUMBER($has_value) ->
|
|
166
|
-
[one] {" "}to <code data-l10n-name="value">{ $flag_value }</code>
|
|
167
|
-
*[other] {""}
|
|
168
|
-
}{"."}
|
|
169
|
-
{ NUMBER($has_pref_url) ->
|
|
170
|
-
[one] { $flag_type ->
|
|
171
|
-
[preference] To change preferences in { $browser_name }, visit { $browser_pref_url }.
|
|
172
|
-
*[other] {""}
|
|
173
|
-
}
|
|
174
|
-
*[other] {""}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
compat-legend = Legend
|
|
178
|
-
compat-legend-tip = Tip: you can click/tap on a cell for more information.
|
|
179
|
-
compat-legend-yes = { compat-support-full }
|
|
180
|
-
compat-legend-partial = { compat-support-partial }
|
|
181
|
-
compat-legend-preview = In development. Supported in a pre-release version.
|
|
182
|
-
compat-legend-no = { compat-support-no }
|
|
183
|
-
compat-legend-unknown = Compatibility unknown
|
|
184
|
-
compat-legend-experimental = { compat-experimental }. Expect behavior to change in the future.
|
|
185
|
-
compat-legend-nonstandard = { compat-nonstandard }. Check cross-browser support before using.
|
|
186
|
-
compat-legend-deprecated = { compat-deprecated }. Not for use in new websites.
|
|
187
|
-
compat-legend-footnote = See implementation notes.
|
|
188
|
-
compat-legend-disabled = User must explicitly enable this feature.
|
|
189
|
-
compat-legend-altname = Uses a non-standard name.
|
|
190
|
-
compat-legend-prefix = Requires a vendor prefix or different name for use.
|
|
191
|
-
compat-legend-more = Has more compatibility info.
|
|
192
|
-
|
|
193
|
-
placement-note = Ad
|
|
194
|
-
placement-no = Don't want to see ads?
|
|
195
|
-
|
|
196
|
-
pagination-next = Next page
|
|
197
|
-
pagination-prev = Previous page
|
|
198
|
-
pagination-current = Current page
|
|
199
|
-
pagination-goto = Go to page { $page }
|
|
200
|
-
|
|
201
|
-
logout = Sign out
|
|
202
|
-
login = Log in
|
|
203
|
-
settings = My settings
|
|
204
|
-
|
|
205
|
-
example-play-button-label = Play
|
|
206
|
-
example-play-button-title = Run example in MDN Playground (opens in new tab)
|
|
207
|
-
`,i={"en-US":s,de:`content-feedback-question = War diese \xdcbersetzung hilfreich?
|
|
208
|
-
content-feedback-reason = Warum war diese \xdcbersetzung nicht hilfreich?
|
|
209
|
-
content-feedback-thanks = Vielen Dank f\xfcr die R\xfcckmeldung!
|
|
210
|
-
|
|
211
|
-
reference-toc-header = In diesem Artikel
|
|
212
|
-
|
|
213
|
-
footer-tagline = Dein Bauplan f\xfcr ein besseres Internet.
|
|
214
|
-
footer-mofo = Besuche die gemeinn\xfctzige Muttergesellschaft der <a data-l10n-name="moco">Mozilla Corporation</a>, die <a data-l10n-name="mofo">Mozilla Foundation</a>.
|
|
215
|
-
footer-copyright = Teile dieses Inhalts sind \xa91998–{ $year } von einzelnen mozilla.org-Mitwirkenden. Inhalte sind verf\xfcgbar unter <a data-l10n-name="cc">einer Creative-Commons-Lizenz</a>.
|
|
216
|
-
|
|
217
|
-
search-modal-site-search = Erweiterte Suche nach <em>{ $query }</em>
|
|
218
|
-
|
|
219
|
-
site-search-search-stats = { $results } Dokumente gefunden.
|
|
220
|
-
site-search-suggestion-matches = { $relation ->
|
|
221
|
-
[gt] mehr als { $matches ->
|
|
222
|
-
[one] { $matches } \xdcbereinstimmung
|
|
223
|
-
*[other] { $matches } \xdcbereinstimmungen
|
|
224
|
-
}
|
|
225
|
-
*[eq] { $matches ->
|
|
226
|
-
[one] { $matches } \xdcbereinstimmung
|
|
227
|
-
*[other] { $matches } \xdcbereinstimmungen
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
site-search-suggestions-text = Meinten Sie:
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
theme-default = Systemstandard
|
|
234
|
-
|
|
235
|
-
blog-time-to-read = { $minutes ->
|
|
236
|
-
[one] { $minutes } Minute Lesezeit
|
|
237
|
-
*[other] { $minutes } Minuten Lesezeit
|
|
238
|
-
}
|
|
239
|
-
blog-post-not-found = Blogartikel nicht gefunden.
|
|
240
|
-
|
|
241
|
-
blog-previous = Voriger Artikel
|
|
242
|
-
blog-next = N\xe4chster Artikel
|
|
243
|
-
|
|
244
|
-
No = Nein
|
|
245
|
-
Submit = Abschicken
|
|
246
|
-
Yes = Ja
|
|
247
|
-
|
|
248
|
-
obs-report = Report
|
|
249
|
-
|
|
250
|
-
obs-title = HTTP Observatory
|
|
251
|
-
obs-landing-intro = Seit 2016 verbessert HTTP Observatory die Sicherheit durch Analyse der Einhaltung bew\xe4hrter Sicherheitspraktiken. Es hat durch 47 Millionen Scans Einblicke in \xfcber 6,9 Millionen Websites geliefert.
|
|
252
|
-
obs-assessment = Das von Mozilla entwickelte HTTP Observatory f\xfchrt eine umfassende Bewertung der HTTP-Header und weiterer zentraler Sicherheitskonfigurationen einer Website durch.
|
|
253
|
-
obs-scanning = Der automatisierte Scan-Prozess liefert Entwicklern und Website-Administratoren detailliertes, handlungsorientiertes Feedback und konzentriert sich darauf, potenzielle Sicherheitsl\xfccken zu erkennen und zu beheben.
|
|
254
|
-
obs-security = Das Tool unterst\xfctzt Entwickler und Website-Administratoren ma\xdfgeblich dabei, ihre Websites in einem sich stetig weiterentwickelnden digitalen Umfeld gegen h\xe4ufige Sicherheitsbedrohungen abzusichern.
|
|
255
|
-
obs-mdn = Das HTTP Observatory bietet wirksame Sicherheitseinblicke auf Grundlage von Mozillas Expertise und Engagement f\xfcr ein sichereres Internet sowie basierend auf etablierten Trends und Richtlinien.
|
|
256
|
-
`,es:`blog-toc-title = En este art\xedculo
|
|
257
|
-
|
|
258
|
-
`,fr:`blog-toc-title = Dans cet article
|
|
259
|
-
`,ja:`blog-toc-title = この記事では
|
|
260
|
-
|
|
261
|
-
`,ko:`blog-toc-title = 목차
|
|
262
|
-
`,"pt-BR":`blog-toc-title = Neste artigo
|
|
263
|
-
|
|
264
|
-
`,ru:`blog-toc-title = В этой статье
|
|
265
|
-
`,"zh-CN":`blog-toc-title = 在本文中
|
|
266
|
-
`,"zh-TW":`blog-toc-title = 在本文中
|
|
267
|
-
`},l=["i","strong","br","em"],c=["title","aria-label"];let Fluent=class Fluent{constructor(e="en-US",t=[]){this.locale=e,this.usBundle=Fluent.constructBundle(new o.Np(e),[s]),t.length>0&&(this.bundle=Fluent.constructBundle(new o.Np(e),[s,...t]))}static constructBundle(e,t=[]){for(let n of t){let t=e.addResource(new o.B$(n),{allowOverrides:!0});t.length>0&&console.error(t)}return e}get(e,t,n,o){let a=this.getMessage(e,t,n);if(a)return Fluent.sanitize(a,o)}static sanitize(e,t={}){let n={};for(let e of Object.values(t))n[e.tag]=[...Object.keys(e).filter(e=>"tag"!==e),...c];let o=[...Object.values(t).map(e=>e.tag),...l],s=!0,i=a(e,{allowedAttributes:n,allowedTags:o,allowedSchemes:["http","https","mailto"],filter(e){let n=e.attrs["data-l10n-name"];if(n)for(let[o,a]of Object.entries(t[n]||{}))e.attrs[o]=a;return!!(l.includes(e.tag)||n&&Object.keys(t).includes(n)&&t[n]?.tag===e.tag)&&(s=!1,!0)}},!0);return s?i:(0,r._)(i)}getMessage(e,t,n={},o=this.bundle,a=!1){let r,s=o?o.getMessage(e):void 0;if("qa"===this.locale)return`[${e}${t?`.${t}`:""}]`;if(!s){if(a)return;return this.getMessage(e,t,n,this.usBundle,!0)}if(t){if(!(r=s.attributes[t])){if(a)return;return this.getMessage(e,t,n,this.usBundle,!0)}}else s.value&&(r=s.value);if(!r||!o)return"";let i=[],l=o?.formatPattern(r,n,i);return i.length>0&&console.error(i),l}};let d=new Map;function u(e){if(e){if(!d.has(e)){let t=i[e],n=new Fluent(e,t?[t]:void 0);d.set(e,n)}return d.get(e)}}let m=e=>class extends e{constructor(...e){let t,n;super(...e);let o=(t=globalThis.__MDNServerContext?.getStore(),n=globalThis.__MDNClientContext,t||n);this.locale=o.locale,this.l10n=function(e){function t(t,n){if("string"==typeof t){let n=u(e)?.get(t),o=`[${t}]`,a=e=>{let t=e[0];return n||t||o};return a.toString=()=>"string"==typeof n&&n||o,a}return t[0]||""}return t.raw=function({id:t,attr:n,args:o,elements:a}){let r=u(e);return r?r.get(t,n,o,a):`[${t}]`},t}(this.locale)}}},4591:function(){globalThis.__MDNClientContext={locale:globalThis.location.pathname.split("/")[1]||"en-US"}},39943:function(e,t,n){n.d(t,{w:()=>a});var o=n(92);function a(e){o.A.recordElementClick({id:e,url:globalThis.location.href,referrer:document.referrer,title:document.title})}},90528:function(e,t,n){n.d(t,{o:()=>o});function o(e,t){let n=e.replaceAll("_"," ").split("/").filter(e=>!["",t,"docs"].includes(e));return(n=n.map(e=>"API"===e?"Web APIs":e)).length>1&&"Web"===n.at(0)&&n.splice(0,1),n.length>1&&n.splice(-1,1),n.join(" / ")}}};import e from"./runtime.b178b9749f31202a.js";import*as t from"./5935.b56577341146e516.js";e.C(t);import*as n from"./1127.49790b26827d316c.js";e.C(n);import*as o from"./index.26176fe4ab13dce5.js";e.C(o),e(e.s=31051);
|
|
268
|
-
//# sourceMappingURL=index.26176fe4ab13dce5.js.map
|