Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
Since February 2026, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
メモ: この機能はウェブワーカー内で利用可能です。
TrustedScript は信頼型 API のインターフェイスで、開発者がスクリプトを実行する可能性のある注入先に挿入できる、コンパイルされていないスクリプト本体を持つ文字列を表します。これらのオブジェクトは TrustedTypePolicy.createScript() によって作成されるため、コンストラクターはありません。
TrustedScript オブジェクトの値は、オブジェクトの作成時に設定され、公開されたセッターが存在しないため、JavaScript によって変更することはできません。
格納されているデータの JSON 表現を返します。
TrustedScript.toString()文字列で、無害化された HTML です。
定数 sanitized は、信頼型ポリシーによって作成されたオブジェクトです。
| Trusted Types # trusted-script |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025年10月13日 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.