Better field names for details object

This commit is contained in:
Cheng Zhao 2017-12-20 10:25:31 +09:00
parent 4d7b85bd01
commit 4fd8b04329
3 changed files with 8 additions and 10 deletions

View file

@ -106,8 +106,7 @@ void WebContentsPermissionHelper::RequestOpenExternalPermission(
bool user_gesture, bool user_gesture,
const GURL& url) { const GURL& url) {
base::DictionaryValue details; base::DictionaryValue details;
details.SetString("scheme", url.scheme()); details.SetString("externalURL", url.spec());
details.SetString("url", url.spec());
RequestPermissionWithDetails( RequestPermissionWithDetails(
static_cast<content::PermissionType>(PermissionType::OPEN_EXTERNAL), static_cast<content::PermissionType>(PermissionType::OPEN_EXTERNAL),
callback, user_gesture, &details); callback, user_gesture, &details);

View file

@ -294,8 +294,7 @@ win.webContents.session.setCertificateVerifyProc((request, callback) => {
* `callback` Function * `callback` Function
* `permissionGranted` Boolean - Allow or deny the permission. * `permissionGranted` Boolean - Allow or deny the permission.
* `details` Object - Some properties are only available on certain permission types. * `details` Object - Some properties are only available on certain permission types.
* `url` String - The url of the `openExternal` request. * `externalURL` String - The url of the `openExternal` request.
* `scheme` String - The protocol scheme of the `openExternal` request.
Sets the handler which can be used to respond to permission requests for the `session`. 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. Calling `callback(true)` will allow the permission and `callback(false)` will reject it.