diff --git a/dom/base/nsGlobalWindowInner.cpp b/dom/base/nsGlobalWindowInner.cpp index f40fceaaa299..75887a7c1724 100644 --- a/dom/base/nsGlobalWindowInner.cpp +++ b/dom/base/nsGlobalWindowInner.cpp @@ -2982,12 +2982,6 @@ bool nsGlobalWindowInner::IsPrivilegedChromeWindow(JSContext* aCx, nsContentUtils::GetSystemPrincipal(); } -/* static */ -bool nsGlobalWindowInner::OfflineCacheAllowedForContext(JSContext* aCx, - JSObject* aObj) { - return IsSecureContextOrObjectIsFromSecureContext(aCx, aObj); -} - /* static */ bool nsGlobalWindowInner::IsRequestIdleCallbackEnabled(JSContext* aCx, JSObject* aObj) { diff --git a/dom/base/nsGlobalWindowInner.h b/dom/base/nsGlobalWindowInner.h index 852cc02d8cd3..2d1b687d0ace 100644 --- a/dom/base/nsGlobalWindowInner.h +++ b/dom/base/nsGlobalWindowInner.h @@ -387,9 +387,6 @@ class nsGlobalWindowInner final : public mozilla::dom::EventTarget, static bool IsPrivilegedChromeWindow(JSContext* /* unused */, JSObject* aObj); - static bool OfflineCacheAllowedForContext(JSContext* /* unused */, - JSObject* aObj); - static bool IsRequestIdleCallbackEnabled(JSContext* aCx, JSObject* /* unused */); diff --git a/dom/webidl/OfflineResourceList.webidl b/dom/webidl/OfflineResourceList.webidl index 75df4e2f296d..35a017d78f12 100644 --- a/dom/webidl/OfflineResourceList.webidl +++ b/dom/webidl/OfflineResourceList.webidl @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -[Pref="browser.cache.offline.enable", Func="nsGlobalWindowInner::OfflineCacheAllowedForContext", +[SecureContext, Pref="browser.cache.offline.enable", Exposed=Window] interface OfflineResourceList : EventTarget { /** diff --git a/dom/webidl/Window.webidl b/dom/webidl/Window.webidl index cfe78606fea9..92e22bc1fc58 100644 --- a/dom/webidl/Window.webidl +++ b/dom/webidl/Window.webidl @@ -72,7 +72,7 @@ typedef OfflineResourceList ApplicationCache; #ifdef HAVE_SIDEBAR [Replaceable, Throws] readonly attribute External external; #endif - [Throws, Pref="browser.cache.offline.enable", Func="nsGlobalWindowInner::OfflineCacheAllowedForContext"] readonly attribute ApplicationCache applicationCache; + [Throws, SecureContext, Pref="browser.cache.offline.enable"] readonly attribute ApplicationCache applicationCache; // user prompts [Throws, NeedsSubjectPrincipal] void alert();