Get to know MDN better
Since February 2026, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
Note: This feature is available in Web Workers.
The toJSON() method of the TrustedScriptURL interface returns a JSON representation of the stored data.
None.
A string containing a JSON representation of the stored data.
The constant sanitized is an object created via a Trusted Types policy. The toString() method returns a string to safely use to load a third party script.
| Trusted Types # dom-trustedscripturl-tojson |
Enable JavaScript to view this browser compatibility table.
This page was last modified on May 13, 2024 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.