New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 631464 link

Starred by 41 users

Issue metadata

Status: Fixed
Owner:
Last visit 25 days ago
Closed: Sep 3
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature

Blocking:
issue 776649
issue 817397



Sign in to add a comment

DevTools: Make it possible to control permissions via protocol

Project Member Reported by skyos...@chromium.org, Jul 26 2016

Issue description

We should make it possible to query/grant permissions using DevTools. This could be used, for example, to observe the page requesting geolocation access and to accept/reject that request.

Also see https://bugs.chromium.org/p/chromium/issues/detail?id=546706 for discussion about a command line flag.
 
Labels: -Type-Bug Type-Feature

Comment 2 by phistuck@gmail.com, Jul 26 2016

I think it only makes sense in headless mode. The desktop user interface of Chrome lets you set an "Always allow" using the page information box (lock or page icon next to the URL) to anything.
I think Peter mentioned that that triggers a page reload, which can be a little inconvenient in some cases.
Owner: skyos...@chromium.org
Status: Assigned (was: Available)
Summary: DevTools: Make it possible to control permissions via protocol (was: Make it possible to control permissions via DevTools)
skyostil@: mind me assigning to you? open to reviewing a CL if you have one/
Sure, we'll try get to this at some point. Just wanted to know that you have no allergic reaction to this idea :)
Cc: ericbidelman@chromium.org
We would also like this for Lighthouse. Here's a rough strawman of potential API:

Methods like:
  Permission.forceAllow(permissionType)
  Permission.forceReject(permissionType)

Event for 
  Permission.permissionChanged: permissionType, status

And Permission.disable() would revert back to previously saved permissions.
Labels: HeadlessUpForGrabs
Cc: skyos...@chromium.org
Owner: ----
Status: Available (was: Assigned)
Owner: pfeldman@chromium.org
Status: Assigned (was: Available)
We can introduce a new "Permission" domain handler on the chrome/browser level that would talk to chrome/browser/permissions/permission_manager.h. PermissionManager would need minimal changes for that.

But that would not work for headless. Sami, how were you planning to implement it?
I guess we could intercept it on the content level, let me look into it.
I haven't looked at the details yet, but intercepting in content sounds plausible.
Components: Internals>Headless
Cc: krajshree@chromium.org
 Issue 729256  has been merged into this issue.
Status: WontFix (was: Assigned)
Sami, I need something more concrete to keep this alive.
The proposal in comment 6 seems pretty straightforward? I haven't heard anyone asking for this recently so it's fine to downprioritize, but I think we should still keep this open as a potential feature.
Let's file it or reopen when we feel it is the time for implementation. In the middle of aggressive triaging!
There's a downstream request for this in Puppeteer:

https://github.com/GoogleChrome/puppeteer/issues/846
Status: Assigned (was: WontFix)
Lighthouse's usecase is already satisfied via `Log.startViolationsReport` and then listening to `Log.entryAdded` for an entry of:

> 'Only request geolocation information in response to a user gesture.'


If users want to know that a permission prompt was triggered and not attached to a user gesture... they're good.

If users want to know that a permission prompt was triggered after a click, they currently do not have a protocol-level feature for this. 

--------

The other use cases would be someone wanting to write integration tests exploring multiple ways of accepting/blocking permissions.

I'm OK with waiting until we have a more solid customer.
Status: WontFix (was: Assigned)
> ...someone wanting to write integration tests

That's a strong use case that I think we should support, especially now with Puppeteer. Shops will want to do e2e testing and without a way to control permissions, it's hard to full test important features: PWA push notifications, a maps app that uses geolocation, multimedia app that uses the device apis.

Perhaps we should keep this open so people can star it? Already has 13 stars!
I agree with Eric.

I'm currently writing a map-application and in order to write Nightwatch-tests to test features happening on the map it would a good thing for the geolocation to work.

My 5c into this.
Blocking: 776649
I would like to provide a few use cases for such an API :

- A developer implementing web push notifications on their web site can write tests to check whether a user is able to subscribe to and receive web push notifications.

- A developer integrating geolocation API requests, in their core product would also benefit, by being able to test the functionality.

Any feedback would be appreciated.
This would solve my current issue dealing with running UI tests dependent on geocolation running in headless mode on a build server.
Owner: ----
Status: Available (was: WontFix)
Owner: lushnikov@chromium.org
Status: Assigned (was: Available)
Another use case:

I was trying to setup some e2e tests (using Puppeteer) for an app that uses the getUserMedia API to request a video stream from the user's camera. This requires granting permissions, which I cannot do programmatically.
Blocking: 817397
Another use case:

I'm implementing complex e2e tests too (with chrome headless) and I need to start microphone and video to make my tests pass.

The permission box appear but I've no way to accept permission programmatically...

#30: getUserMedia has been covered for ages: https://peter.sh/experiments/chromium-command-line-switches/#use-fake-ui-for-media-stream
(you might also want the fake device)
I'm seeing this problem with allowing notifications in chrome while using puppeteer.


Comment 33 by os...@stockly.ai, Jun 25 2018

With the new Clipboard API (https://developers.google.com/web/updates/2018/03/clipboardapi) any E2E test requiring simulating copy/paste events would require to access control permissions. I would love to see this implemented. Personally I'm using pupeteer and there's currently no way to emulate a paste event. 
Cc: lushnikov@chromium.org
 Issue 854888  has been merged into this issue.
Status: Started (was: Assigned)
Project Member

Comment 36 by bugdroid1@chromium.org, Jul 12

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ebff0440cc1ada42a20446c0f6d9ddf0619f64df

commit ebff0440cc1ada42a20446c0f6d9ddf0619f64df
Author: Andrey Lushnikov <lushnikov@chromium.org>
Date: Thu Jul 12 20:02:58 2018

Make content::PermissionManager a delegate of PermissionController

One-pager describing this refactoring: https://goo.gl/24gkCb

Today, `content/` layer provides `permission_manager.h` interface that
is supposed to be implemented by embedders and simultaneously used
as API in `content/` layer. This leaves us with no place in content/ layer
where we can put DevTools instrumentation.

This patch separates content API from embedder interface. With this
patch, `content/` layer provides 2 interfaces:
- content::PermissionController - content-level API to manage permissions
- content::PermissionManager - interface to be implemented by
embedders. This is a delegate for content::PermissionController.

This design enables DevTools to handle and override content permissions through
DevTools protocol. The functionality will be encapsulated in
PermissionController class.

There's exactly one PermissionController for each BrowserContext.
If embedder doesn't implement PermissionManager, then
PermissionController rejects all permission requests.

In a follow-up:
- rename `content::PermissionManager` into `content::PermissionControllerDelegate`.
- rename `BrowserContext::GetPermissionManager()` into `BrowserContext::GetPermissionControllerDelegate()`.
- rename `TestBrowserContext::SetPermissionManager()` into `TestBrowserContext::SetPermissionControllerDelegate()`.

R=dgozman
TBR=sdefresne, tobiasjs, slan, thakis
BUG= 631464 

Change-Id: I5f6f1ea5b28e284c462a5055d9b072f12f30ce19
Reviewed-on: https://chromium-review.googlesource.com/1111340
Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574691}
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/android_webview/browser/aw_permission_manager.cc
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/chrome/browser/net/reporting_permissions_checker.cc
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/chrome/browser/notifications/platform_notification_service_impl.cc
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/chrome/browser/permissions/permission_manager.cc
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/chromecast/browser/cast_permission_manager.cc
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/components/domain_reliability/service.cc
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/components/domain_reliability/service_unittest.cc
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/components/payments/content/installable_payment_app_crawler.cc
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/browser/BUILD.gn
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/browser/background_sync/background_sync_manager.cc
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/browser/browser_context.cc
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/browser/frame_host/render_frame_host_impl.cc
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/browser/generic_sensor/sensor_provider_proxy_impl.cc
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/browser/generic_sensor/sensor_provider_proxy_impl.h
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/browser/geolocation/geolocation_service_impl.cc
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/browser/geolocation/geolocation_service_impl.h
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/browser/geolocation/geolocation_service_impl_unittest.cc
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/browser/notifications/blink_notification_service_impl.cc
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/browser/payments/payment_app_provider_impl.cc
[add] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/browser/permissions/permission_controller_impl.cc
[add] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/browser/permissions/permission_controller_impl.h
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/browser/permissions/permission_service_context.cc
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/browser/permissions/permission_service_impl.cc
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/browser/push_messaging/push_messaging_manager.cc
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/public/browser/BUILD.gn
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/public/browser/browser_context.h
[add] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/public/browser/permission_controller.h
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/public/browser/permission_manager.h
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/public/test/mock_permission_manager.cc
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/shell/browser/layout_test/layout_test_permission_manager.cc
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/content/shell/browser/shell_permission_manager.cc
[modify] https://crrev.com/ebff0440cc1ada42a20446c0f6d9ddf0619f64df/headless/lib/browser/headless_permission_manager.cc

FWIW, this has also been asked for a fair bit for WebPageTest for perf testing apps that rely on location information.

I work around it on desktop by writing a prefs file set to always-allow location but that doesn't work on Android (and it would be nice to avoid the prefs hack).
Project Member

Comment 38 by bugdroid1@chromium.org, Jul 16

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f350010aaefed4ab84f9a5e2876e65db53d67753

commit f350010aaefed4ab84f9a5e2876e65db53d67753
Author: Andrey Lushnikov <lushnikov@chromium.org>
Date: Mon Jul 16 19:55:22 2018

Rename content::PermissionManager into content::PermissionControllerDelegate

One-pager describing this refactoring: https://goo.gl/24gkCb

This is a follow-up to the crrev.com/574691
This patch:
- renames content::PermissionManager into content::PermissionControllerDelegate
- renames BrowserContext::GetPermissionManager() into BrowserContext::GetPermissionControllerDelegate
- renames content::TestBrowserContext::SetPermissionManager into TestBrowserContext::SetPermissionControllerDelegate

R=dgozman
TBR=boliu, scottmg, xunjieli, spang, thestig
BUG= 631464 

Change-Id: I01ca186635898d250877e7462a731e47ffae31c3
Reviewed-on: https://chromium-review.googlesource.com/1136858
Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575393}
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/android_webview/browser/aw_browser_context.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/android_webview/browser/aw_browser_context.h
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/android_webview/browser/aw_permission_manager.h
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/android_webview/browser/aw_permission_manager_unittest.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/chrome/browser/net/chrome_network_delegate_unittest.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/chrome/browser/net/reporting_permissions_checker_unittest.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/chrome/browser/notifications/notification_permission_context_unittest.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/chrome/browser/notifications/platform_notification_service_unittest.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/chrome/browser/permissions/permission_manager.h
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/chrome/browser/permissions/permission_manager_unittest.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/chrome/browser/profiles/off_the_record_profile_impl.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/chrome/browser/profiles/off_the_record_profile_impl.h
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/chrome/browser/profiles/profile_impl.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/chrome/browser/profiles/profile_impl.h
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/chrome/browser/push_messaging/push_messaging_service_unittest.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/chrome/browser/storage/durable_storage_permission_context_unittest.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/chrome/browser/ui/app_list/test/fake_profile.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/chrome/browser/ui/app_list/test/fake_profile.h
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/chrome/browser/webauthn/chrome_authenticator_request_delegate.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/chrome/test/base/testing_profile.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/chrome/test/base/testing_profile.h
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/chromecast/browser/cast_browser_context.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/chromecast/browser/cast_browser_context.h
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/chromecast/browser/cast_permission_manager.h
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/components/domain_reliability/service_unittest.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/content/browser/background_sync/background_sync_manager_unittest.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/content/browser/background_sync/background_sync_service_impl_unittest.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/content/browser/geolocation/geolocation_service_impl_unittest.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/content/browser/notifications/blink_notification_service_impl_unittest.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/content/browser/payments/payment_app_provider_impl_unittest.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/content/browser/permissions/permission_controller_impl.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/content/public/browser/BUILD.gn
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/content/public/browser/browser_context.h
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/content/public/browser/permission_controller.h
[rename] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/content/public/browser/permission_controller_delegate.h
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/content/public/test/mock_permission_manager.h
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/content/public/test/test_browser_context.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/content/public/test/test_browser_context.h
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/content/shell/browser/layout_test/layout_test_browser_context.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/content/shell/browser/layout_test/layout_test_browser_context.h
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/content/shell/browser/layout_test/layout_test_permission_manager.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/content/shell/browser/layout_test/layout_test_permission_manager.h
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/content/shell/browser/layout_test/layout_test_push_messaging_service.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/content/shell/browser/shell_browser_context.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/content/shell/browser/shell_browser_context.h
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/content/shell/browser/shell_permission_manager.h
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/headless/lib/browser/headless_browser_context_impl.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/headless/lib/browser/headless_browser_context_impl.h
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/headless/lib/browser/headless_permission_manager.h
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/headless/lib/headless_browser_browsertest.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/webrunner/browser/webrunner_browser_context.cc
[modify] https://crrev.com/f350010aaefed4ab84f9a5e2876e65db53d67753/webrunner/browser/webrunner_browser_context.h

Project Member

Comment 39 by bugdroid1@chromium.org, Aug 22

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3a29ade7a13ef2e763f330cdb0df4b5bd459c600

commit 3a29ade7a13ef2e763f330cdb0df4b5bd459c600
Author: Andrey Lushnikov <lushnikov@chromium.org>
Date: Wed Aug 22 17:05:13 2018

DevTools: move browser context management to devtools_manager_delegate

This patch:
- moves browser context management to devtools_manager_delegate
- implements browser context related protocol methods in content/

R=dgozman

Bug:  631464 
Change-Id: Ia43343d5c2208556214b41225cb05f744f2d9ccd
Reviewed-on: https://chromium-review.googlesource.com/1183594
Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585102}
[modify] https://crrev.com/3a29ade7a13ef2e763f330cdb0df4b5bd459c600/chrome/browser/devtools/BUILD.gn
[modify] https://crrev.com/3a29ade7a13ef2e763f330cdb0df4b5bd459c600/chrome/browser/devtools/chrome_devtools_manager_delegate.cc
[modify] https://crrev.com/3a29ade7a13ef2e763f330cdb0df4b5bd459c600/chrome/browser/devtools/chrome_devtools_manager_delegate.h
[add] https://crrev.com/3a29ade7a13ef2e763f330cdb0df4b5bd459c600/chrome/browser/devtools/devtools_browser_context_manager.cc
[add] https://crrev.com/3a29ade7a13ef2e763f330cdb0df4b5bd459c600/chrome/browser/devtools/devtools_browser_context_manager.h
[modify] https://crrev.com/3a29ade7a13ef2e763f330cdb0df4b5bd459c600/chrome/browser/devtools/inspector_protocol_config.json
[modify] https://crrev.com/3a29ade7a13ef2e763f330cdb0df4b5bd459c600/chrome/browser/devtools/protocol/target_handler.cc
[modify] https://crrev.com/3a29ade7a13ef2e763f330cdb0df4b5bd459c600/chrome/browser/devtools/protocol/target_handler.h
[modify] https://crrev.com/3a29ade7a13ef2e763f330cdb0df4b5bd459c600/content/browser/devtools/protocol/target_handler.cc
[modify] https://crrev.com/3a29ade7a13ef2e763f330cdb0df4b5bd459c600/content/browser/devtools/protocol/target_handler.h
[modify] https://crrev.com/3a29ade7a13ef2e763f330cdb0df4b5bd459c600/content/browser/devtools/protocol_config.json
[modify] https://crrev.com/3a29ade7a13ef2e763f330cdb0df4b5bd459c600/content/public/browser/devtools_manager_delegate.cc
[modify] https://crrev.com/3a29ade7a13ef2e763f330cdb0df4b5bd459c600/content/public/browser/devtools_manager_delegate.h
[modify] https://crrev.com/3a29ade7a13ef2e763f330cdb0df4b5bd459c600/headless/lib/browser/headless_devtools_manager_delegate.cc
[modify] https://crrev.com/3a29ade7a13ef2e763f330cdb0df4b5bd459c600/headless/lib/browser/headless_devtools_manager_delegate.h
[modify] https://crrev.com/3a29ade7a13ef2e763f330cdb0df4b5bd459c600/headless/lib/browser/protocol/target_handler.cc
[modify] https://crrev.com/3a29ade7a13ef2e763f330cdb0df4b5bd459c600/headless/lib/browser/protocol/target_handler.h
[modify] https://crrev.com/3a29ade7a13ef2e763f330cdb0df4b5bd459c600/headless/protocol_config.json

Project Member

Comment 40 by bugdroid1@chromium.org, Aug 23

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666

commit 36299bc62c0d5d99c6c3bfecf9db2495d9d2e666
Author: Andrey Lushnikov <lushnikov@chromium.org>
Date: Thu Aug 23 22:09:54 2018

DevTools: introduce Browser.grantPermissions

This patch adds permission management over DevTools protocol:
- Browser.grantPermissions to grant permissions to origin
- Browser.resetPermissions to reset devtools permissions to defaults

Testing overview:
- content_shell's devtools manager delegate is updated to resolve the default
  browser context. This way functionality can be tested in layout_tests
- a new browser-grant-permissions.js test is added to test added methods
- geolocation test is rewritten to use protocol instead of PermissionsUtil layout_test hook
  to verify that protocol permissions work with geolocation overrides.

BUG= 631464 
R=dgozman

Change-Id: I6d9451339c319781c47c7db9db02c9cd08115c26
Reviewed-on: https://chromium-review.googlesource.com/1185877
Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585630}
[modify] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/chrome/browser/devtools/chrome_devtools_manager_delegate.cc
[modify] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/chrome/browser/devtools/chrome_devtools_manager_delegate.h
[modify] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/chrome/browser/devtools/devtools_browser_context_manager.cc
[modify] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/chrome/browser/devtools/devtools_browser_context_manager.h
[modify] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/content/browser/devtools/protocol/browser_handler.cc
[modify] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/content/browser/devtools/protocol/browser_handler.h
[modify] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/content/browser/devtools/protocol_config.json
[modify] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/content/browser/permissions/permission_controller_impl.cc
[modify] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/content/browser/permissions/permission_controller_impl.h
[modify] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/content/public/browser/devtools_manager_delegate.cc
[modify] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/content/public/browser/devtools_manager_delegate.h
[modify] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/content/shell/browser/layout_test/layout_test_permission_manager.cc
[modify] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/content/shell/browser/shell_devtools_manager_delegate.cc
[modify] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/content/shell/browser/shell_devtools_manager_delegate.h
[modify] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/headless/lib/browser/headless_devtools_manager_delegate.cc
[modify] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/headless/lib/browser/headless_devtools_manager_delegate.h
[modify] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/third_party/WebKit/LayoutTests/http/tests/devtools/geolocation-emulation-tests-expected.txt
[modify] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/third_party/WebKit/LayoutTests/http/tests/devtools/geolocation-emulation-tests.js
[add] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/browser-grant-permissions-expected.txt
[add] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/browser-grant-permissions.js
[add] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/empty.html
[modify] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/third_party/blink/renderer/core/inspector/browser_protocol.pdl
[modify] https://crrev.com/36299bc62c0d5d99c6c3bfecf9db2495d9d2e666/third_party/blink/renderer/devtools/front_end/test_runner/TestRunner.js

Status: Fixed (was: Started)
This is done. 

Note: puppeteer@next (future 1.8.0) supports this via `BrowserContext.overridePermissions` call:
- https://pptr.dev/#?product=Puppeteer&version=master&show=api-browsercontextoverridepermissionsorigin-permissions
Project Member

Comment 42 by bugdroid1@chromium.org, Nov 2

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/73b2202e2fe3bbd668318c035861277e55efb08d

commit 73b2202e2fe3bbd668318c035861277e55efb08d
Author: Pavel Feldman <pfeldman@chromium.org>
Date: Fri Nov 02 02:55:30 2018

DevTools: respect permission overrides on the chrome level.

This is a follow up to the content-side change, we need chrome
to respect these overrides as well when the check originates
outside of the web platform.

Bug:  631464 
Change-Id: I8300a17d6b2b65140aef8232a58a694e56a709e3
Reviewed-on: https://chromium-review.googlesource.com/c/1308935
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604815}
[modify] https://crrev.com/73b2202e2fe3bbd668318c035861277e55efb08d/chrome/browser/devtools/chrome_devtools_manager_delegate.h
[modify] https://crrev.com/73b2202e2fe3bbd668318c035861277e55efb08d/chrome/browser/devtools/inspector_protocol_config.json
[modify] https://crrev.com/73b2202e2fe3bbd668318c035861277e55efb08d/chrome/browser/devtools/protocol/browser_handler.cc
[modify] https://crrev.com/73b2202e2fe3bbd668318c035861277e55efb08d/chrome/browser/devtools/protocol/browser_handler.h
[modify] https://crrev.com/73b2202e2fe3bbd668318c035861277e55efb08d/chrome/browser/permissions/permission_manager.cc
[modify] https://crrev.com/73b2202e2fe3bbd668318c035861277e55efb08d/chrome/browser/permissions/permission_manager.h

Sign in to add a comment