diff options
Diffstat (limited to 'dom/base/nsDocument.cpp')
-rw-r--r-- | dom/base/nsDocument.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index dc4b23f2ce..76490e6b44 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -12446,3 +12446,16 @@ nsIDocument::GetSelection(ErrorResult& aRv) return nsGlobalWindow::Cast(window)->GetSelection(aRv); } + +bool +nsIDocument::ModuleScriptsEnabled() +{ + static bool sEnabledForContent = false; + static bool sCachedPref = false; + if (!sCachedPref) { + sCachedPref = true; + Preferences::AddBoolVarCache(&sEnabledForContent, "dom.moduleScripts.enabled", false); + } + + return nsContentUtils::IsChromeDoc(this) || sEnabledForContent; +}
\ No newline at end of file |