Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(522)

Unified Diff: third_party/WebKit/Source/modules/installedapp/NavigatorInstalledApp.cpp

Issue 2800523004: Restrict navigator.getInstalledRelatedApps() to top-level frames (Closed)
Patch Set: update error (top-level frames -> top-level browing contexts) Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/installedapp/getinstalledrelatedapps-iframe.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/installedapp/NavigatorInstalledApp.cpp
diff --git a/third_party/WebKit/Source/modules/installedapp/NavigatorInstalledApp.cpp b/third_party/WebKit/Source/modules/installedapp/NavigatorInstalledApp.cpp
index f95d791768c0da5a4396b726d80fd4679931f21e..f76d3cb9522c83294f35ad55a1c139db70b9785f 100644
--- a/third_party/WebKit/Source/modules/installedapp/NavigatorInstalledApp.cpp
+++ b/third_party/WebKit/Source/modules/installedapp/NavigatorInstalledApp.cpp
@@ -80,6 +80,15 @@ ScriptPromise NavigatorInstalledApp::getInstalledRelatedApps(
return promise;
}
+ if (!appController->supplementable()->isMainFrame()) {
+ DOMException* exception =
+ DOMException::create(InvalidStateError,
+ "getInstalledRelatedApps() is only supported in "
+ "top-level browsing contexts.");
+ resolver->reject(exception);
+ return promise;
+ }
+
appController->getInstalledRelatedApps(
WTF::wrapUnique(
new CallbackPromiseAdapter<RelatedAppArray, void>(resolver)));
« no previous file with comments | « third_party/WebKit/LayoutTests/installedapp/getinstalledrelatedapps-iframe.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698