1 /* eslint-disable mozilla/no-comparison-or-assignment-inside-ok */
3 // This is a list of all interfaces that are exposed to workers.
4 // Please only add things to this list with great care and proper review
5 // from the associated module peers.
7 // This file lists global interfaces we want exposed and verifies they
8 // are what we intend. Each entry in the arrays below can either be a
9 // simple string with the interface name, or an object with a 'name'
10 // property giving the interface name as a string, and additional
11 // properties which qualify the exposure of that interface. For example:
14 // "AGlobalInterface", // secure context only
15 // { name: "ExperimentalThing", release: false },
16 // { name: "ReallyExperimentalThing", nightly: true },
17 // { name: "DesktopOnlyThing", desktop: true },
18 // { name: "FancyControl", xbl: true },
19 // { name: "DisabledEverywhere", disabled: true },
22 // See createInterfaceMap() below for a complete list of properties.
24 // The values of the properties need to be literal true/false
25 // (e.g. indicating whether something is enabled on a particular
26 // channel/OS). If we ever end up in a situation where a propert
27 // value needs to depend on channel or OS, we will need to make sure
28 // we have that information before setting up the property lists.
30 // IMPORTANT: Do not change this list without review from
31 // a JavaScript Engine peer!
32 let wasmGlobalEntry = {
34 insecureContext: true,
35 disabled: !getJSTestingFunctions().wasmIsSupportedByHardware(),
37 let wasmGlobalInterfaces = [
38 { name: "Module", insecureContext: true },
39 { name: "Instance", insecureContext: true },
40 { name: "Memory", insecureContext: true },
41 { name: "Table", insecureContext: true },
42 { name: "Global", insecureContext: true },
43 { name: "CompileError", insecureContext: true },
44 { name: "LinkError", insecureContext: true },
45 { name: "RuntimeError", insecureContext: true },
46 { name: "Function", insecureContext: true, nightly: true },
47 { name: "Exception", insecureContext: true },
48 { name: "Tag", insecureContext: true },
49 { name: "compile", insecureContext: true },
50 { name: "compileStreaming", insecureContext: true },
51 { name: "instantiate", insecureContext: true },
52 { name: "instantiateStreaming", insecureContext: true },
53 { name: "validate", insecureContext: true },
55 // IMPORTANT: Do not change this list without review from
56 // a JavaScript Engine peer!
58 { name: "AggregateError", insecureContext: true },
59 { name: "Array", insecureContext: true },
60 { name: "ArrayBuffer", insecureContext: true },
61 { name: "Atomics", insecureContext: true },
62 { name: "BigInt", insecureContext: true },
63 { name: "BigInt64Array", insecureContext: true },
64 { name: "BigUint64Array", insecureContext: true },
65 { name: "Boolean", insecureContext: true },
66 { name: "DataView", insecureContext: true },
67 { name: "Date", insecureContext: true },
68 { name: "Error", insecureContext: true },
69 { name: "EvalError", insecureContext: true },
70 { name: "FinalizationRegistry", insecureContext: true },
71 { name: "Float32Array", insecureContext: true },
72 { name: "Float64Array", insecureContext: true },
73 { name: "Function", insecureContext: true },
74 { name: "Infinity", insecureContext: true },
75 { name: "Int16Array", insecureContext: true },
76 { name: "Int32Array", insecureContext: true },
77 { name: "Int8Array", insecureContext: true },
78 { name: "InternalError", insecureContext: true },
79 { name: "Intl", insecureContext: true },
80 { name: "JSON", insecureContext: true },
81 { name: "Map", insecureContext: true },
82 { name: "MediaCapabilities", insecureContext: true },
83 { name: "MediaCapabilitiesInfo", insecureContext: true },
84 { name: "Math", insecureContext: true },
85 { name: "NaN", insecureContext: true },
86 { name: "Number", insecureContext: true },
87 { name: "Object", insecureContext: true },
88 { name: "Promise", insecureContext: true },
89 { name: "Proxy", insecureContext: true },
90 { name: "RangeError", insecureContext: true },
91 { name: "ReferenceError", insecureContext: true },
92 { name: "Reflect", insecureContext: true },
93 { name: "RegExp", insecureContext: true },
94 { name: "Set", insecureContext: true },
96 name: "SharedArrayBuffer",
97 insecureContext: true,
98 crossOringinIsolated: true,
100 { name: "String", insecureContext: true },
101 { name: "Symbol", insecureContext: true },
102 { name: "SyntaxError", insecureContext: true },
103 { name: "TypeError", insecureContext: true },
104 { name: "Uint16Array", insecureContext: true },
105 { name: "Uint32Array", insecureContext: true },
106 { name: "Uint8Array", insecureContext: true },
107 { name: "Uint8ClampedArray", insecureContext: true },
108 { name: "URIError", insecureContext: true },
109 { name: "WeakMap", insecureContext: true },
110 { name: "WeakRef", insecureContext: true },
111 { name: "WeakSet", insecureContext: true },
113 { name: "decodeURI", insecureContext: true },
114 { name: "decodeURIComponent", insecureContext: true },
115 { name: "encodeURI", insecureContext: true },
116 { name: "encodeURIComponent", insecureContext: true },
117 { name: "escape", insecureContext: true },
118 { name: "eval", insecureContext: true },
119 { name: "globalThis", insecureContext: true },
120 { name: "isFinite", insecureContext: true },
121 { name: "isNaN", insecureContext: true },
122 { name: "parseFloat", insecureContext: true },
123 { name: "parseInt", insecureContext: true },
124 { name: "undefined", insecureContext: true },
125 { name: "unescape", insecureContext: true },
127 // IMPORTANT: Do not change the list above without review from
128 // a JavaScript Engine peer!
130 // IMPORTANT: Do not change the list below without review from a DOM peer!
131 let interfaceNamesInGlobalScope = [
132 // IMPORTANT: Do not change this list without review from a DOM peer!
133 { name: "AbortController", insecureContext: true },
134 // IMPORTANT: Do not change this list without review from a DOM peer!
135 { name: "AbortSignal", insecureContext: true },
136 // IMPORTANT: Do not change this list without review from a DOM peer!
137 { name: "AudioData", insecureContext: true, nightly: true },
138 // IMPORTANT: Do not change this list without review from a DOM peer!
139 { name: "AudioDecoder", nightly: true },
140 // IMPORTANT: Do not change this list without review from a DOM peer!
141 { name: "AudioEncoder", nightly: true },
142 // IMPORTANT: Do not change this list without review from a DOM peer!
143 { name: "Blob", insecureContext: true },
144 // IMPORTANT: Do not change this list without review from a DOM peer!
145 { name: "BroadcastChannel", insecureContext: true },
146 // IMPORTANT: Do not change this list without review from a DOM peer!
147 { name: "ByteLengthQueuingStrategy", insecureContext: true },
148 // IMPORTANT: Do not change this list without review from a DOM peer!
150 // IMPORTANT: Do not change this list without review from a DOM peer!
152 // IMPORTANT: Do not change this list without review from a DOM peer!
153 { name: "CanvasGradient", insecureContext: true },
154 // IMPORTANT: Do not change this list without review from a DOM peer!
155 { name: "CanvasPattern", insecureContext: true },
156 // IMPORTANT: Do not change this list without review from a DOM peer!
157 { name: "CloseEvent", insecureContext: true },
158 // IMPORTANT: Do not change this list without review from a DOM peer!
159 { name: "CompressionStream", insecureContext: true },
160 // IMPORTANT: Do not change this list without review from a DOM peer!
161 { name: "CountQueuingStrategy", insecureContext: true },
162 // IMPORTANT: Do not change this list without review from a DOM peer!
163 { name: "Crypto", insecureContext: true },
164 // IMPORTANT: Do not change this list without review from a DOM peer!
165 { name: "CryptoKey" },
166 // IMPORTANT: Do not change this list without review from a DOM peer!
167 { name: "CustomEvent", insecureContext: true },
168 // IMPORTANT: Do not change this list without review from a DOM peer!
169 { name: "DecompressionStream", insecureContext: true },
170 // IMPORTANT: Do not change this list without review from a DOM peer!
171 { name: "DedicatedWorkerGlobalScope", insecureContext: true },
172 // IMPORTANT: Do not change this list without review from a DOM peer!
173 { name: "Directory", insecureContext: true },
174 // IMPORTANT: Do not change this list without review from a DOM peer!
175 { name: "DOMException", insecureContext: true },
176 // IMPORTANT: Do not change this list without review from a DOM peer!
177 { name: "DOMMatrix", insecureContext: true },
178 // IMPORTANT: Do not change this list without review from a DOM peer!
179 { name: "DOMMatrixReadOnly", insecureContext: true },
180 // IMPORTANT: Do not change this list without review from a DOM peer!
181 { name: "DOMPoint", insecureContext: true },
182 // IMPORTANT: Do not change this list without review from a DOM peer!
183 { name: "DOMPointReadOnly", insecureContext: true },
184 // IMPORTANT: Do not change this list without review from a DOM peer!
185 { name: "DOMQuad", insecureContext: true },
186 // IMPORTANT: Do not change this list without review from a DOM peer!
187 { name: "DOMRect", insecureContext: true },
188 // IMPORTANT: Do not change this list without review from a DOM peer!
189 { name: "DOMRectReadOnly", insecureContext: true },
190 // IMPORTANT: Do not change this list without review from a DOM peer!
191 { name: "DOMStringList", insecureContext: true },
192 // IMPORTANT: Do not change this list without review from a DOM peer!
193 { name: "EncodedAudioChunk", insecureContext: true, nightly: true },
194 // IMPORTANT: Do not change this list without review from a DOM peer!
195 { name: "EncodedVideoChunk", insecureContext: true, nightly: true },
196 // IMPORTANT: Do not change this list without review from a DOM peer!
197 { name: "ErrorEvent", insecureContext: true },
198 // IMPORTANT: Do not change this list without review from a DOM peer!
199 { name: "Event", insecureContext: true },
200 // IMPORTANT: Do not change this list without review from a DOM peer!
201 { name: "EventSource", insecureContext: true },
202 // IMPORTANT: Do not change this list without review from a DOM peer!
203 { name: "EventTarget", insecureContext: true },
204 // IMPORTANT: Do not change this list without review from a DOM peer!
205 { name: "File", insecureContext: true },
206 // IMPORTANT: Do not change this list without review from a DOM peer!
207 { name: "FileList", insecureContext: true },
208 // IMPORTANT: Do not change this list without review from a DOM peer!
209 { name: "FileReader", insecureContext: true },
210 // IMPORTANT: Do not change this list without review from a DOM peer!
211 { name: "FileReaderSync", insecureContext: true },
212 // IMPORTANT: Do not change this list without review from a DOM peer!
213 { name: "FileSystemDirectoryHandle" },
214 // IMPORTANT: Do not change this list without review from a DOM peer!
215 { name: "FileSystemFileHandle" },
216 // IMPORTANT: Do not change this list without review from a DOM peer!
217 { name: "FileSystemHandle" },
218 // IMPORTANT: Do not change this list without review from a DOM peer!
219 { name: "FileSystemSyncAccessHandle" },
220 // IMPORTANT: Do not change this list without review from a DOM peer!
221 { name: "FileSystemWritableFileStream" },
222 // IMPORTANT: Do not change this list without review from a DOM peer!
223 { name: "FontFace", insecureContext: true },
224 // IMPORTANT: Do not change this list without review from a DOM peer!
225 { name: "FontFaceSet", insecureContext: true },
226 // IMPORTANT: Do not change this list without review from a DOM peer!
227 { name: "FontFaceSetLoadEvent", insecureContext: true },
228 // IMPORTANT: Do not change this list without review from a DOM peer!
229 { name: "FormData", insecureContext: true },
230 // IMPORTANT: Do not change this list without review from a DOM peer!
231 { name: "Headers", insecureContext: true },
232 // IMPORTANT: Do not change this list without review from a DOM peer!
233 { name: "IDBCursor", insecureContext: true },
234 // IMPORTANT: Do not change this list without review from a DOM peer!
235 { name: "IDBCursorWithValue", insecureContext: true },
236 // IMPORTANT: Do not change this list without review from a DOM peer!
237 { name: "IDBDatabase", insecureContext: true },
238 // IMPORTANT: Do not change this list without review from a DOM peer!
239 { name: "IDBFactory", insecureContext: true },
240 // IMPORTANT: Do not change this list without review from a DOM peer!
241 { name: "IDBIndex", insecureContext: true },
242 // IMPORTANT: Do not change this list without review from a DOM peer!
243 { name: "IDBKeyRange", insecureContext: true },
244 // IMPORTANT: Do not change this list without review from a DOM peer!
245 { name: "IDBObjectStore", insecureContext: true },
246 // IMPORTANT: Do not change this list without review from a DOM peer!
247 { name: "IDBOpenDBRequest", insecureContext: true },
248 // IMPORTANT: Do not change this list without review from a DOM peer!
249 { name: "IDBRequest", insecureContext: true },
250 // IMPORTANT: Do not change this list without review from a DOM peer!
251 { name: "IDBTransaction", insecureContext: true },
252 // IMPORTANT: Do not change this list without review from a DOM peer!
253 { name: "IDBVersionChangeEvent", insecureContext: true },
254 // IMPORTANT: Do not change this list without review from a DOM peer!
255 { name: "ImageBitmap", insecureContext: true },
256 // IMPORTANT: Do not change this list without review from a DOM peer!
257 { name: "ImageBitmapRenderingContext", insecureContext: true },
258 // IMPORTANT: Do not change this list without review from a DOM peer!
259 { name: "ImageData", insecureContext: true },
260 // IMPORTANT: Do not change this list without review from a DOM peer!
262 // IMPORTANT: Do not change this list without review from a DOM peer!
264 // IMPORTANT: Do not change this list without review from a DOM peer!
265 { name: "MessageChannel", insecureContext: true },
266 // IMPORTANT: Do not change this list without review from a DOM peer!
267 { name: "MessageEvent", insecureContext: true },
268 // IMPORTANT: Do not change this list without review from a DOM peer!
269 { name: "MessagePort", insecureContext: true },
270 // IMPORTANT: Do not change this list without review from a DOM peer!
271 { name: "NetworkInformation", insecureContext: true, disabled: true },
272 // IMPORTANT: Do not change this list without review from a DOM peer!
273 { name: "Notification", insecureContext: true },
274 // IMPORTANT: Do not change this list without review from a DOM peer!
275 { name: "OffscreenCanvas", insecureContext: true },
276 // IMPORTANT: Do not change this list without review from a DOM peer!
277 { name: "OffscreenCanvasRenderingContext2D", insecureContext: true },
278 // IMPORTANT: Do not change this list without review from a DOM peer!
279 { name: "Path2D", insecureContext: true },
280 // IMPORTANT: Do not change this list without review from a DOM peer!
281 { name: "Performance", insecureContext: true },
282 // IMPORTANT: Do not change this list without review from a DOM peer!
283 { name: "PerformanceEntry", insecureContext: true },
284 // IMPORTANT: Do not change this list without review from a DOM peer!
285 { name: "PerformanceMark", insecureContext: true },
286 // IMPORTANT: Do not change this list without review from a DOM peer!
287 { name: "PerformanceMeasure", insecureContext: true },
288 // IMPORTANT: Do not change this list without review from a DOM peer!
289 { name: "PerformanceObserver", insecureContext: true },
290 // IMPORTANT: Do not change this list without review from a DOM peer!
291 { name: "PerformanceObserverEntryList", insecureContext: true },
292 // IMPORTANT: Do not change this list without review from a DOM peer!
293 { name: "PerformanceResourceTiming", insecureContext: true },
294 // IMPORTANT: Do not change this list without review from a DOM peer!
295 { name: "PerformanceServerTiming", insecureContext: false },
296 // IMPORTANT: Do not change this list without review from a DOM peer!
297 { name: "ProgressEvent", insecureContext: true },
298 // IMPORTANT: Do not change this list without review from a DOM peer!
299 { name: "PromiseRejectionEvent", insecureContext: true },
300 // IMPORTANT: Do not change this list without review from a DOM peer!
301 // IMPORTANT: Do not change this list without review from a DOM peer!
302 { name: "ReadableByteStreamController", insecureContext: true },
303 // IMPORTANT: Do not change this list without review from a DOM peer!
304 { name: "ReadableStream", insecureContext: true },
305 // IMPORTANT: Do not change this list without review from a DOM peer!
306 { name: "ReadableStreamBYOBReader", insecureContext: true },
307 // IMPORTANT: Do not change this list without review from a DOM peer!
308 { name: "ReadableStreamBYOBRequest", insecureContext: true },
309 // IMPORTANT: Do not change this list without review from a DOM peer!
310 { name: "ReadableStreamDefaultController", insecureContext: true },
311 // IMPORTANT: Do not change this list without review from a DOM peer!
312 { name: "ReadableStreamDefaultReader", insecureContext: true },
313 // IMPORTANT: Do not change this list without review from a DOM peer!
314 { name: "Request", insecureContext: true },
315 // IMPORTANT: Do not change this list without review from a DOM peer!
316 { name: "Response", insecureContext: true },
317 // IMPORTANT: Do not change this list without review from a DOM peer!
318 { name: "RTCEncodedAudioFrame", insecureContext: true },
319 // IMPORTANT: Do not change this list without review from a DOM peer!
320 { name: "RTCEncodedVideoFrame", insecureContext: true },
321 // IMPORTANT: Do not change this list without review from a DOM peer!
322 { name: "RTCRtpScriptTransformer", insecureContext: true },
323 // IMPORTANT: Do not change this list without review from a DOM peer!
324 { name: "RTCTransformEvent", insecureContext: true },
325 // IMPORTANT: Do not change this list without review from a DOM peer!
326 { name: "Scheduler", insecureContext: true, nightly: true },
327 // IMPORTANT: Do not change this list without review from a DOM peer!
328 { name: "StorageManager", fennec: false },
329 // IMPORTANT: Do not change this list without review from a DOM peer!
330 { name: "SubtleCrypto" },
331 // IMPORTANT: Do not change this list without review from a DOM peer!
332 { name: "TaskController", insecureContext: true, nightly: true },
333 // IMPORTANT: Do not change this list without review from a DOM peer!
334 { name: "TaskPriorityChangeEvent", insecureContext: true, nightly: true },
335 // IMPORTANT: Do not change this list without review from a DOM peer!
336 { name: "TaskSignal", insecureContext: true, nightly: true },
337 // IMPORTANT: Do not change this list without review from a DOM peer!
338 { name: "TextDecoder", insecureContext: true },
339 // IMPORTANT: Do not change this list without review from a DOM peer!
340 { name: "TextDecoderStream", insecureContext: true },
341 // IMPORTANT: Do not change this list without review from a DOM peer!
342 { name: "TextEncoder", insecureContext: true },
343 // IMPORTANT: Do not change this list without review from a DOM peer!
344 { name: "TextEncoderStream", insecureContext: true },
345 // IMPORTANT: Do not change this list without review from a DOM peer!
346 { name: "TextMetrics", insecureContext: true },
347 // IMPORTANT: Do not change this list without review from a DOM peer!
348 { name: "TransformStream", insecureContext: true },
349 // IMPORTANT: Do not change this list without review from a DOM peer!
351 name: "TransformStreamDefaultController",
352 insecureContext: true,
354 // IMPORTANT: Do not change this list without review from a DOM peer!
355 { name: "XMLHttpRequest", insecureContext: true },
356 // IMPORTANT: Do not change this list without review from a DOM peer!
357 { name: "XMLHttpRequestEventTarget", insecureContext: true },
358 // IMPORTANT: Do not change this list without review from a DOM peer!
359 { name: "XMLHttpRequestUpload", insecureContext: true },
360 // IMPORTANT: Do not change this list without review from a DOM peer!
361 { name: "URL", insecureContext: true },
362 // IMPORTANT: Do not change this list without review from a DOM peer!
363 { name: "URLSearchParams", insecureContext: true },
364 // IMPORTANT: Do not change this list without review from a DOM peer!
365 { name: "VideoColorSpace", insecureContext: true, nightly: true },
366 // IMPORTANT: Do not change this list without review from a DOM peer!
367 { name: "VideoDecoder", nightly: true },
368 // IMPORTANT: Do not change this list without review from a DOM peer!
369 { name: "VideoEncoder", nightly: true },
370 // IMPORTANT: Do not change this list without review from a DOM peer!
371 { name: "VideoFrame", insecureContext: true, nightly: true },
372 // IMPORTANT: Do not change this list without review from a DOM peer!
373 { name: "WebGL2RenderingContext", insecureContext: true },
374 // IMPORTANT: Do not change this list without review from a DOM peer!
375 { name: "WebGLActiveInfo", insecureContext: true },
376 // IMPORTANT: Do not change this list without review from a DOM peer!
377 { name: "WebGLBuffer", insecureContext: true },
378 // IMPORTANT: Do not change this list without review from a DOM peer!
379 { name: "WebGLContextEvent", insecureContext: true },
380 // IMPORTANT: Do not change this list without review from a DOM peer!
381 { name: "WebGLFramebuffer", insecureContext: true },
382 // IMPORTANT: Do not change this list without review from a DOM peer!
383 { name: "WebGLProgram", insecureContext: true },
384 // IMPORTANT: Do not change this list without review from a DOM peer!
385 { name: "WebGLQuery", insecureContext: true },
386 // IMPORTANT: Do not change this list without review from a DOM peer!
387 { name: "WebGLRenderbuffer", insecureContext: true },
388 // IMPORTANT: Do not change this list without review from a DOM peer!
389 { name: "WebGLRenderingContext", insecureContext: true },
390 // IMPORTANT: Do not change this list without review from a DOM peer!
391 { name: "WebGLSampler", insecureContext: true },
392 // IMPORTANT: Do not change this list without review from a DOM peer!
393 { name: "WebGLShader", insecureContext: true },
394 // IMPORTANT: Do not change this list without review from a DOM peer!
395 { name: "WebGLShaderPrecisionFormat", insecureContext: true },
396 // IMPORTANT: Do not change this list without review from a DOM peer!
397 { name: "WebGLSync", insecureContext: true },
398 // IMPORTANT: Do not change this list without review from a DOM peer!
399 { name: "WebGLTexture", insecureContext: true },
400 // IMPORTANT: Do not change this list without review from a DOM peer!
401 { name: "WebGLTransformFeedback", insecureContext: true },
402 // IMPORTANT: Do not change this list without review from a DOM peer!
403 { name: "WebGLUniformLocation", insecureContext: true },
404 // IMPORTANT: Do not change this list without review from a DOM peer!
405 { name: "WebGLVertexArrayObject", insecureContext: true },
406 // IMPORTANT: Do not change this list without review from a DOM peer!
407 { name: "WebSocket", insecureContext: true },
408 // IMPORTANT: Do not change this list without review from a DOM peer!
409 { name: "WebTransport", insecureContext: false },
410 // IMPORTANT: Do not change this list without review from a DOM peer!
411 { name: "WebTransportBidirectionalStream", insecureContext: false },
412 // IMPORTANT: Do not change this list without review from a DOM peer!
413 { name: "WebTransportDatagramDuplexStream", insecureContext: false },
414 // IMPORTANT: Do not change this list without review from a DOM peer!
415 { name: "WebTransportError", insecureContext: false },
416 // IMPORTANT: Do not change this list without review from a DOM peer!
417 { name: "WebTransportReceiveStream", insecureContext: false },
418 // IMPORTANT: Do not change this list without review from a DOM peer!
419 { name: "WebTransportSendStream", insecureContext: false },
420 // IMPORTANT: Do not change this list without review from a DOM peer!
421 { name: "Worker", insecureContext: true },
422 // IMPORTANT: Do not change this list without review from a DOM peer!
423 { name: "WorkerGlobalScope", insecureContext: true },
424 // IMPORTANT: Do not change this list without review from a DOM peer!
425 { name: "WorkerLocation", insecureContext: true },
426 // IMPORTANT: Do not change this list without review from a DOM peer!
427 { name: "WorkerNavigator", insecureContext: true },
428 // IMPORTANT: Do not change this list without review from a DOM peer!
429 { name: "WritableStream", insecureContext: true },
430 // IMPORTANT: Do not change this list without review from a DOM peer!
431 { name: "WritableStreamDefaultController", insecureContext: true },
432 // IMPORTANT: Do not change this list without review from a DOM peer!
433 { name: "WritableStreamDefaultWriter", insecureContext: true },
434 // IMPORTANT: Do not change this list without review from a DOM peer!
435 { name: "cancelAnimationFrame", insecureContext: true },
436 // IMPORTANT: Do not change this list without review from a DOM peer!
437 { name: "close", insecureContext: true },
438 // IMPORTANT: Do not change this list without review from a DOM peer!
439 { name: "console", insecureContext: true },
440 // IMPORTANT: Do not change this list without review from a DOM peer!
441 { name: "name", insecureContext: true },
442 // IMPORTANT: Do not change this list without review from a DOM peer!
443 { name: "onmessage", insecureContext: true },
444 // IMPORTANT: Do not change this list without review from a DOM peer!
445 { name: "onmessageerror", insecureContext: true },
446 // IMPORTANT: Do not change this list without review from a DOM peer!
447 { name: "onrtctransform", insecureContext: true },
448 // IMPORTANT: Do not change this list without review from a DOM peer!
449 { name: "postMessage", insecureContext: true },
450 // IMPORTANT: Do not change this list without review from a DOM peer!
451 { name: "requestAnimationFrame", insecureContext: true },
452 // IMPORTANT: Do not change this list without review from a DOM peer!
454 // IMPORTANT: Do not change the list above without review from a DOM peer!
456 // List of functions defined on the global by the test harness or this test
458 let testFunctions = [
461 "workerTestArrayEquals",
463 "workerTestGetPermissions",
464 "workerTestGetHelperData",
466 "createInterfaceMap",
470 function entryDisabled(
474 isEarlyBetaOrEarlier,
480 isCrossOringinIsolated,
484 entry.nightly === !isNightly ||
485 (entry.nightlyAndroid === !(isAndroid && isNightly) && isAndroid) ||
486 entry.desktop === !isDesktop ||
487 (entry.android === !isAndroid && !entry.nightlyAndroid) ||
488 entry.fennecOrDesktop === (isAndroid && !isFennec) ||
489 entry.fennec === !isFennec ||
490 entry.release === !isRelease ||
491 // The insecureContext test is very purposefully converting
492 // entry.insecureContext to boolean, so undefined will convert to
493 // false. That way entries without an insecureContext annotation
494 // will get treated as "insecureContext: false", which means exposed
495 // only in secure contexts.
496 (isInsecureContext && !entry.insecureContext) ||
497 entry.earlyBetaOrEarlier === !isEarlyBetaOrEarlier ||
498 entry.crossOringinIsolated === !isCrossOringinIsolated ||
503 function createInterfaceMap(data, ...interfaceGroups) {
504 var interfaceMap = {};
506 function addInterfaces(interfaces) {
507 for (var entry of interfaces) {
508 if (typeof entry === "string") {
509 ok(!(entry in interfaceMap), "duplicate entry for " + entry);
510 interfaceMap[entry] = !data.isInsecureContext;
512 ok(!(entry.name in interfaceMap), "duplicate entry for " + entry.name);
513 ok(!("pref" in entry), "Bogus pref annotation for " + entry.name);
514 interfaceMap[entry.name] = !entryDisabled(entry, data);
519 for (let interfaceGroup of interfaceGroups) {
520 addInterfaces(interfaceGroup);
526 function runTest(parentName, parent, data, ...interfaceGroups) {
527 var interfaceMap = createInterfaceMap(data, ...interfaceGroups);
528 for (var name of Object.getOwnPropertyNames(parent)) {
529 // Ignore functions on the global that are part of the test (harness).
530 if (parent === self && testFunctions.includes(name)) {
535 "If this is failing: DANGER, are you sure you want to expose the new interface " +
537 " to all webpages as a property of " +
539 "? Do not make a change to this file without a " +
540 " review from a DOM peer for that specific change!!! (or a JS peer for changes to ecmaGlobals)"
542 delete interfaceMap[name];
544 for (var name of Object.keys(interfaceMap)) {
546 name in parent === interfaceMap[name],
549 (interfaceMap[name] ? "" : " NOT") +
553 if (!interfaceMap[name]) {
554 delete interfaceMap[name];
558 Object.keys(interfaceMap).length,
560 "The following interface(s) are not enumerated: " +
561 Object.keys(interfaceMap).join(", ")
565 workerTestGetHelperData(function (data) {
566 runTest("self", self, data, ecmaGlobals, interfaceNamesInGlobalScope);
567 if (WebAssembly && !entryDisabled(wasmGlobalEntry, data)) {
568 runTest("WebAssembly", WebAssembly, data, wasmGlobalInterfaces);