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.
メモ: この機能はウェブワーカー内で利用可能です。
emptyScript は TrustedTypePolicyFactory インターフェイスの読み取り専用プロパティで、空文字列の入った TrustedScript オブジェクトを返します。
このオブジェクトは、アプリケーションが TrustedScript オブジェクトを期待する注入先に空の文字列を挿入する必要がある場合に使用できます。
TrustedScript オブジェクトです。
仕様では、 emptyScript オブジェクトを使用して動的コードコンパイルのサポートを検出できることが使用できます。
ネイティブの信頼型実装は eval(TrustedScript) を使用可能であるため、下記例ではネイティブ実装は eval(trustedTypes.emptyScript) に対して false を返します。ポリフィルは真値オブジェクトを返します。
| Trusted Types # dom-trustedtypepolicyfactory-emptyscript |
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.