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.
メモ: この機能はウェブワーカー内で利用可能です。
isScript() は TrustedTypePolicyFactory インターフェイスのメソッドで、渡されたものが有効な TrustedScript オブジェクトであった場合は true を返します。
メモ: 関数 isScript()、isHTML()、isScriptURL() の目的は、オブジェクトが設定済みポリシーによって作成された有効な信頼型オブジェクトであるかどうかを確認することです。
TrustedScript オブジェクトです。
論理値 (boolean) で、オブジェクトが有効な TrustedScript オブジェクトであれば true です。
以下の例では、定数 url はポリシーによって作成されたため、isScriptURL() は true を返します。2 つ目の例はオブジェクトを偽装しようとした試みであり、3 つ目は文字列です。これらはいずれも isScriptURL() に渡すと false を返します。
| Trusted Types # dom-trustedtypepolicyfactory-isscript |
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.