New issue
Advanced search Search tips

Issue 891803 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 9
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 1
Type: Bug



Sign in to add a comment

Extensions requesting specific sites should have toggles in chrome://extensions page

Project Member Reported by rdevlin....@chromium.org, Oct 3

Issue description

For extensions that request a specific set of sites (rather than <all_urls>, *.com, etc), we should show a list of toggles in the chrome://extensions page for the "on specific sites" option.  This allows users to know which sites the extension wants to run on, and tweak them.

bklmn@, I'll take a first stab here, and run the screenshot by you to get your guidance (unless you already had mocks ready?).
 
Project Member

Comment 1 by bugdroid1@chromium.org, Oct 9

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

commit 5c7b323d5a9ac77216afc1d736ee1f1baef003d2
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Tue Oct 09 04:29:00 2018

[Extensions Click-to-Script] Extend chrome://extensions page info

Extend the developerPrivate.Permissions struct with more information
about runtime host permissions. Include the withheld hosts for the
extension, as well as whether the extension requests all hosts. This CL
only extends the struct with extra information, but does not change the
current behavior of the page.

Update unittests for the same, and add additional coverage for an
extension requesting only specific sites.

Bug:  891803 

Cq-Include-Trybots: luci.chromium.try:closure_compilation
Change-Id: If485a788eb2f843240a5b92750f0cb4f6b8392c3
Reviewed-on: https://chromium-review.googlesource.com/c/1256212
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Karan Bhatia <karandeepb@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597796}
[modify] https://crrev.com/5c7b323d5a9ac77216afc1d736ee1f1baef003d2/chrome/browser/extensions/api/developer_private/extension_info_generator.cc
[modify] https://crrev.com/5c7b323d5a9ac77216afc1d736ee1f1baef003d2/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc
[modify] https://crrev.com/5c7b323d5a9ac77216afc1d736ee1f1baef003d2/chrome/browser/resources/md_extensions/runtime_host_permissions.html
[modify] https://crrev.com/5c7b323d5a9ac77216afc1d736ee1f1baef003d2/chrome/browser/resources/md_extensions/runtime_host_permissions.js
[modify] https://crrev.com/5c7b323d5a9ac77216afc1d736ee1f1baef003d2/chrome/common/extensions/api/developer_private.idl
[modify] https://crrev.com/5c7b323d5a9ac77216afc1d736ee1f1baef003d2/chrome/test/data/webui/extensions/runtime_host_permissions_test.js
[modify] https://crrev.com/5c7b323d5a9ac77216afc1d736ee1f1baef003d2/third_party/closure_compiler/externs/developer_private.js

WIP implementation
Selection_049.png
18.2 KB View Download
Selection_050.png
18.4 KB View Download
Updated per bklmn's feedback.


Selection_055.png
18.6 KB View Download
Selection_054.png
18.5 KB View Download
Project Member

Comment 4 by bugdroid1@chromium.org, Nov 2

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

commit c169b4e4d62f98dd414958a75ec4fb1ebf0c47d7
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Nov 02 20:52:30 2018

[Extensions Click-to-Script] More extensions page data tweaks

Tweak the data sent to the extensions page slightly more. Move all
runtime host permissions data into a separate field on the
developerPrivate.Permissions struct, and unconditionally populate all
fields (including specific granted hosts) if the feature is enabled.
This simplifies some of the code we need to pass to the
RuntimeHostPermissions element, since we can now just pass
developerPrivate.RuntimeHostPermissions, and paves the way for adding
a separate toggle-able implementation for extensions that request access
to specific sites.

No observable UI or behavior change is expected in this CL.

Update and add tests for the same.

Bug:  891803 

Cq-Include-Trybots: luci.chromium.try:closure_compilation
Change-Id: Id95d3b0a77d8621db811a28fcdcfd705d60ed0f6
Reviewed-on: https://chromium-review.googlesource.com/c/1295271
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Karan Bhatia <karandeepb@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605046}
[modify] https://crrev.com/c169b4e4d62f98dd414958a75ec4fb1ebf0c47d7/chrome/browser/extensions/api/developer_private/extension_info_generator.cc
[modify] https://crrev.com/c169b4e4d62f98dd414958a75ec4fb1ebf0c47d7/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc
[modify] https://crrev.com/c169b4e4d62f98dd414958a75ec4fb1ebf0c47d7/chrome/browser/resources/md_extensions/detail_view.html
[modify] https://crrev.com/c169b4e4d62f98dd414958a75ec4fb1ebf0c47d7/chrome/browser/resources/md_extensions/detail_view.js
[modify] https://crrev.com/c169b4e4d62f98dd414958a75ec4fb1ebf0c47d7/chrome/browser/resources/md_extensions/runtime_host_permissions.html
[modify] https://crrev.com/c169b4e4d62f98dd414958a75ec4fb1ebf0c47d7/chrome/browser/resources/md_extensions/runtime_host_permissions.js
[modify] https://crrev.com/c169b4e4d62f98dd414958a75ec4fb1ebf0c47d7/chrome/common/extensions/api/developer_private.idl
[modify] https://crrev.com/c169b4e4d62f98dd414958a75ec4fb1ebf0c47d7/chrome/test/data/webui/extensions/detail_view_test.js
[modify] https://crrev.com/c169b4e4d62f98dd414958a75ec4fb1ebf0c47d7/chrome/test/data/webui/extensions/runtime_host_permissions_test.js
[modify] https://crrev.com/c169b4e4d62f98dd414958a75ec4fb1ebf0c47d7/third_party/closure_compiler/externs/developer_private.js

Project Member

Comment 5 by bugdroid1@chromium.org, Nov 3

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

commit 0ba08a46abb5a48b211fb1225db0c6729bd13e0f
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Sat Nov 03 04:29:11 2018

[Extensions Click-to-Script] Create a toggle-able list for specific sites

For extensions that only request access to specific sites (e.g., an
extension that only requests access to google.com and example.com),
display a toggle-able list in the chrome://extensions page rather than
a free-form entry field. The ability to grant all requested sites
still exists via a "main" toggle, and disabling this allows the user to
toggle individual sites. This logic is contained in the new
HostPermissionsToggleList custom element.

This is a usability improvement over the free-form entry, since with
free-form entry it's not immediately obvious what the possible options
are.

Free-form entry is still used for extensions that request all sites (or
all-sites like patterns, such as https://*.com), since (almost) any site
entered is valid.

Update and add tests for the same.

Bug:  891803 

Cq-Include-Trybots: luci.chromium.try:closure_compilation
Change-Id: I99112966d323c403603d5f21c28ae33be8e506f0
Reviewed-on: https://chromium-review.googlesource.com/c/1284696
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605150}
[modify] https://crrev.com/0ba08a46abb5a48b211fb1225db0c6729bd13e0f/chrome/browser/resources/md_extensions/BUILD.gn
[modify] https://crrev.com/0ba08a46abb5a48b211fb1225db0c6729bd13e0f/chrome/browser/resources/md_extensions/detail_view.html
[modify] https://crrev.com/0ba08a46abb5a48b211fb1225db0c6729bd13e0f/chrome/browser/resources/md_extensions/detail_view.js
[modify] https://crrev.com/0ba08a46abb5a48b211fb1225db0c6729bd13e0f/chrome/browser/resources/md_extensions/extensions_resources.grd
[add] https://crrev.com/0ba08a46abb5a48b211fb1225db0c6729bd13e0f/chrome/browser/resources/md_extensions/host_permissions_toggle_list.html
[add] https://crrev.com/0ba08a46abb5a48b211fb1225db0c6729bd13e0f/chrome/browser/resources/md_extensions/host_permissions_toggle_list.js
[modify] https://crrev.com/0ba08a46abb5a48b211fb1225db0c6729bd13e0f/chrome/browser/resources/md_extensions/toggle_row.html
[modify] https://crrev.com/0ba08a46abb5a48b211fb1225db0c6729bd13e0f/chrome/browser/resources/md_extensions/toggle_row.js
[modify] https://crrev.com/0ba08a46abb5a48b211fb1225db0c6729bd13e0f/chrome/test/data/webui/extensions/cr_extensions_browsertest.js
[modify] https://crrev.com/0ba08a46abb5a48b211fb1225db0c6729bd13e0f/chrome/test/data/webui/extensions/detail_view_test.js
[add] https://crrev.com/0ba08a46abb5a48b211fb1225db0c6729bd13e0f/chrome/test/data/webui/extensions/host_permissions_toggle_list_test.js

Status: Fixed (was: Started)
This should be fixed, and should likely be merged to M71 (pending internal discussion).
Issue 903962 has been merged into this issue.

Sign in to add a comment