diff --git a/atom/browser/web_contents_permission_helper.cc b/atom/browser/web_contents_permission_helper.cc index 40723fd3b2..f363e2eb40 100644 --- a/atom/browser/web_contents_permission_helper.cc +++ b/atom/browser/web_contents_permission_helper.cc @@ -69,8 +69,8 @@ void WebContentsPermissionHelper::RequestPermissionWithDetails( web_contents_->GetBrowserContext()->GetPermissionManager()); auto origin = web_contents_->GetLastCommittedURL(); permission_manager->RequestPermissionWithDetails( - permission, rfh, origin, false, details, - base::Bind(&OnPermissionResponse, callback)); + permission, rfh, origin, false, details, + base::Bind(&OnPermissionResponse, callback)); } void WebContentsPermissionHelper::RequestFullscreenPermission( @@ -106,8 +106,7 @@ void WebContentsPermissionHelper::RequestOpenExternalPermission( bool user_gesture, const GURL& url) { base::DictionaryValue details; - details.SetString("scheme", url.scheme()); - details.SetString("url", url.spec()); + details.SetString("externalURL", url.spec()); RequestPermissionWithDetails( static_cast(PermissionType::OPEN_EXTERNAL), callback, user_gesture, &details); diff --git a/atom/browser/web_contents_permission_helper.h b/atom/browser/web_contents_permission_helper.h index e0ce3a2bd1..49fa39e386 100644 --- a/atom/browser/web_contents_permission_helper.h +++ b/atom/browser/web_contents_permission_helper.h @@ -45,10 +45,10 @@ class WebContentsPermissionHelper const base::Callback& callback, bool user_gesture = false); void RequestPermissionWithDetails( - content::PermissionType permission, - const base::Callback& callback, - bool user_gesture, - const base::DictionaryValue* details); + content::PermissionType permission, + const base::Callback& callback, + bool user_gesture, + const base::DictionaryValue* details); content::WebContents* web_contents_; diff --git a/docs/api/session.md b/docs/api/session.md index 1eb478533c..24d48fe820 100644 --- a/docs/api/session.md +++ b/docs/api/session.md @@ -294,8 +294,7 @@ win.webContents.session.setCertificateVerifyProc((request, callback) => { * `callback` Function * `permissionGranted` Boolean - Allow or deny the permission. * `details` Object - Some properties are only available on certain permission types. - * `url` String - The url of the `openExternal` request. - * `scheme` String - The protocol scheme of the `openExternal` request. + * `externalURL` String - The url of the `openExternal` request. Sets the handler which can be used to respond to permission requests for the `session`. Calling `callback(true)` will allow the permission and `callback(false)` will reject it.