Skip to content

Commit

Permalink
Fix globals, part 9: trustedTypes (#33415)
Browse files Browse the repository at this point in the history
* move

* Apply suggestions from code review
  • Loading branch information
skyclouds2001 committed May 17, 2024
1 parent b232375 commit fc4f2ea
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 24 deletions.
1 change: 1 addition & 0 deletions files/en-us/_redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10770,6 +10770,7 @@
/en-US/docs/Web/API/treeWalker.filter /en-US/docs/Web/API/TreeWalker/filter
/en-US/docs/Web/API/treeWalker.root /en-US/docs/Web/API/TreeWalker/root
/en-US/docs/Web/API/treeWalker.whatToShow /en-US/docs/Web/API/TreeWalker/whatToShow
/en-US/docs/Web/API/trustedTypes /en-US/docs/Web/API/Window/trustedTypes
/en-US/docs/Web/API/window.URL /en-US/docs/Web/API/URL
/en-US/docs/Web/API/window.URL.createObjectURL /en-US/docs/Web/API/URL/createObjectURL_static
/en-US/docs/Web/API/window.URL.revokeObjectURL /en-US/docs/Web/API/URL/revokeObjectURL_static
Expand Down
23 changes: 0 additions & 23 deletions files/en-us/web/api/trustedtypes/index.md

This file was deleted.

2 changes: 2 additions & 0 deletions files/en-us/web/api/window/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ Note that properties which are objects (e.g., for overriding the prototype of bu
- : Returns the toolbar object.
- {{domxref("Window.top")}} {{ReadOnlyInline}}
- : Returns a reference to the topmost window in the window hierarchy. This property is read only.
- {{domxref("Window.trustedTypes")}} {{ReadOnlyInline}}
- : Returns the {{domxref("TrustedTypePolicyFactory")}} object associated with the global object, providing the entry point for using the {{domxref("Trusted Types API", "", "", "nocode")}}.
- {{domxref("Window.visualViewport")}} {{ReadOnlyInline}}
- : Returns a {{domxref("VisualViewport")}} object which represents the visual viewport for a given window.
- {{domxref("Window.window")}} {{ReadOnlyInline}}
Expand Down
23 changes: 23 additions & 0 deletions files/en-us/web/api/window/trustedtypes/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: "Window: trustedTypes property"
short-title: trustedTypes
slug: Web/API/Window/trustedTypes
page-type: web-api-instance-property
browser-compat: api.trustedTypes
---

{{APIRef("Trusted Types API")}}

The **`trustedTypes`** read-only property of the {{domxref("Window")}} interface returns the {{domxref("TrustedTypePolicyFactory")}} object associated with the global object, providing the entry point for using the {{domxref("Trusted Types API", "", "", "nocode")}}.

## Value

A {{domxref("TrustedTypePolicyFactory")}} object.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
2 changes: 2 additions & 0 deletions files/en-us/web/api/workerglobalscope/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ _This interface inherits properties from the {{domxref("EventTarget")}} interfac
- : Returns the {{domxref("Performance")}} associated with the worker. Only a subset of the properties and methods of the `Performance` interface are available to workers.
- {{domxref("WorkerGlobalScope.scheduler")}} {{ReadOnlyInline}}
- : Returns the {{domxref("Scheduler")}} object associated with the current context. This is the entry point for using the [Prioritized Task Scheduling API](/en-US/docs/Web/API/Prioritized_Task_Scheduling_API).
- {{domxref("WorkerGlobalScope.trustedTypes")}} {{ReadOnlyInline}}
- : Returns the {{domxref("TrustedTypePolicyFactory")}} object associated with the global object, providing the entry point for using the {{domxref("Trusted Types API", "", "", "nocode")}}.
- {{domxref("WorkerGlobalScope.self")}} {{ReadOnlyInline}}
- : Returns a reference to the `WorkerGlobalScope` itself. Most of the time it is a specific scope like {{domxref("DedicatedWorkerGlobalScope")}}, {{domxref("SharedWorkerGlobalScope")}} or {{domxref("ServiceWorkerGlobalScope")}}.

Expand Down
23 changes: 23 additions & 0 deletions files/en-us/web/api/workerglobalscope/trustedtypes/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: "WorkerGlobalScope: trustedTypes property"
short-title: trustedTypes
slug: Web/API/WorkerGlobalScope/trustedTypes
page-type: web-api-instance-property
browser-compat: api.trustedTypes
---

{{APIRef("Trusted Types API")}}

The **`trustedTypes`** read-only property of the {{domxref("WorkerGlobalScope")}} interface returns the {{domxref("TrustedTypePolicyFactory")}} object associated with the global object, providing the entry point for using the {{domxref("Trusted Types API", "", "", "nocode")}}.

## Value

A {{domxref("TrustedTypePolicyFactory")}} object.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
2 changes: 1 addition & 1 deletion files/jsondata/GroupData.json
Original file line number Diff line number Diff line change
Expand Up @@ -1633,7 +1633,7 @@
"TrustedTypePolicyFactory"
],
"methods": [],
"properties": [],
"properties": ["Window.trustedTypes", "WorkerGlobalScope.trustedTypes"],
"events": []
},
"UI Events": {
Expand Down

0 comments on commit fc4f2ea

Please sign in to comment.