We need to add support in the chrome://extensions page for adding/removing specific host permissions.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c9558aabcde29d6caca1cd748b830997664a050f commit c9558aabcde29d6caca1cd748b830997664a050f Author: Devlin Cronin <rdevlin.cronin@chromium.org> Date: Tue May 22 01:25:08 2018 [Extensions Click-To-Script] Add developerPrivate host modifying methods Add the ability to modify the granted host permissions (by either adding additional hosts or removing hosts) of a given extension. This CL introduces the new API methods and unittests for the same, but does not add support in the frontend for the chrome://extensions page. Bug: 844128 Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation Change-Id: I6c32aa2428f3d978b38fc2ef6de38dc049530ab4 Reviewed-on: https://chromium-review.googlesource.com/1062500 Reviewed-by: Ilya Sherman <isherman@chromium.org> Reviewed-by: Karan Bhatia <karandeepb@chromium.org> Commit-Queue: Devlin <rdevlin.cronin@chromium.org> Cr-Commit-Position: refs/heads/master@{#560447} [modify] https://crrev.com/c9558aabcde29d6caca1cd748b830997664a050f/chrome/browser/extensions/api/developer_private/developer_private_api.cc [modify] https://crrev.com/c9558aabcde29d6caca1cd748b830997664a050f/chrome/browser/extensions/api/developer_private/developer_private_api.h [modify] https://crrev.com/c9558aabcde29d6caca1cd748b830997664a050f/chrome/browser/extensions/api/developer_private/developer_private_api_unittest.cc [modify] https://crrev.com/c9558aabcde29d6caca1cd748b830997664a050f/chrome/common/extensions/api/developer_private.idl [modify] https://crrev.com/c9558aabcde29d6caca1cd748b830997664a050f/extensions/browser/extension_function_histogram_value.h [modify] https://crrev.com/c9558aabcde29d6caca1cd748b830997664a050f/third_party/closure_compiler/externs/developer_private.js [modify] https://crrev.com/c9558aabcde29d6caca1cd748b830997664a050f/tools/metrics/histograms/enums.xml
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c60f6582212789ddfecb5f419f55924d6c611bf3 commit c60f6582212789ddfecb5f419f55924d6c611bf3 Author: Devlin Cronin <rdevlin.cronin@chromium.org> Date: Tue Jul 10 21:31:38 2018 [Extensions Click-to-Script] Update chrome://extensions page controls Update the chrome://extensions page controls for use with runtime host permissions. Instead of the previous toggle for "run on all sites", have a selection menu for the choices of "on click", "on all sites", and "on specific sites". If "on specific sites" is selected, a list of the allowed sites is shown. Currently, this does *not* allow editing the list; that functionality will be added in a subsequent CL. Update the developerPrivate API to return more detailed information about the permissions and hosts an extension is granted in order to enable the updated UI. Add tests for both the updated UI and the new and changed data in the developerPrivate API. Bug: 844128 Cq-Include-Trybots: luci.chromium.try:closure_compilation Change-Id: Ic40156231b33b611162fadaaae32db439a9de6ee Reviewed-on: https://chromium-review.googlesource.com/1079427 Reviewed-by: Karan Bhatia <karandeepb@chromium.org> Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org> Commit-Queue: Devlin <rdevlin.cronin@chromium.org> Cr-Commit-Position: refs/heads/master@{#573918} [modify] https://crrev.com/c60f6582212789ddfecb5f419f55924d6c611bf3/chrome/app/md_extensions_strings.grdp [modify] https://crrev.com/c60f6582212789ddfecb5f419f55924d6c611bf3/chrome/browser/extensions/api/developer_private/developer_private_api.cc [modify] https://crrev.com/c60f6582212789ddfecb5f419f55924d6c611bf3/chrome/browser/extensions/api/developer_private/developer_private_api_unittest.cc [modify] https://crrev.com/c60f6582212789ddfecb5f419f55924d6c611bf3/chrome/browser/extensions/api/developer_private/extension_info_generator.cc [modify] https://crrev.com/c60f6582212789ddfecb5f419f55924d6c611bf3/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc [modify] https://crrev.com/c60f6582212789ddfecb5f419f55924d6c611bf3/chrome/browser/resources/md_extensions/detail_view.html [modify] https://crrev.com/c60f6582212789ddfecb5f419f55924d6c611bf3/chrome/browser/resources/md_extensions/detail_view.js [modify] https://crrev.com/c60f6582212789ddfecb5f419f55924d6c611bf3/chrome/browser/resources/md_extensions/item.js [modify] https://crrev.com/c60f6582212789ddfecb5f419f55924d6c611bf3/chrome/browser/resources/md_extensions/service.js [modify] https://crrev.com/c60f6582212789ddfecb5f419f55924d6c611bf3/chrome/browser/ui/webui/extensions/extensions_ui.cc [modify] https://crrev.com/c60f6582212789ddfecb5f419f55924d6c611bf3/chrome/common/extensions/api/developer_private.idl [modify] https://crrev.com/c60f6582212789ddfecb5f419f55924d6c611bf3/chrome/test/data/extensions/api_test/developer/generated_output/behllobkkfkfnphdnhnkndlbkcpglgmj.json [modify] https://crrev.com/c60f6582212789ddfecb5f419f55924d6c611bf3/chrome/test/data/extensions/api_test/developer/generated_output/bjafgdebaacbbbecmhlhpofkepfkgcpa.json [modify] https://crrev.com/c60f6582212789ddfecb5f419f55924d6c611bf3/chrome/test/data/extensions/api_test/developer/generated_output/hpiknbiabeeppbpihjehijgoemciehgk.json [modify] https://crrev.com/c60f6582212789ddfecb5f419f55924d6c611bf3/chrome/test/data/webui/extensions/cr_extensions_browsertest.js [modify] https://crrev.com/c60f6582212789ddfecb5f419f55924d6c611bf3/chrome/test/data/webui/extensions/extension_detail_view_test.js [modify] https://crrev.com/c60f6582212789ddfecb5f419f55924d6c611bf3/chrome/test/data/webui/extensions/extension_test_util.js [modify] https://crrev.com/c60f6582212789ddfecb5f419f55924d6c611bf3/third_party/closure_compiler/externs/developer_private.js
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f3d5b5224b62dda463a2dd55702c09eae50c1bc6 commit f3d5b5224b62dda463a2dd55702c09eae50c1bc6 Author: Devlin Cronin <rdevlin.cronin@chromium.org> Date: Wed Jul 11 02:22:11 2018 [Extensions Click-to-Script] Add RemoveAllGrantedHostPermissions() method Add ScriptingPermissionsModifier::RemoveAllGrantedHostPermissions() to revoke all host permissions that were granted to an extension with the runtime host permissions feature. This includes hosts granted through the runtime host permissions feature (using ScriptingPermissionsModifier methods) and hosts granted through optional permissions using the permissions API. This will be used when adjusting extension host permissions in the chrome://extensions page. Bug: 844128 Change-Id: If45bf0024cb31946cba72e1abf06c27b3ed857b5 Reviewed-on: https://chromium-review.googlesource.com/1128381 Commit-Queue: Devlin <rdevlin.cronin@chromium.org> Reviewed-by: Karan Bhatia <karandeepb@chromium.org> Cr-Commit-Position: refs/heads/master@{#574041} [modify] https://crrev.com/f3d5b5224b62dda463a2dd55702c09eae50c1bc6/chrome/browser/extensions/scripting_permissions_modifier.cc [modify] https://crrev.com/f3d5b5224b62dda463a2dd55702c09eae50c1bc6/chrome/browser/extensions/scripting_permissions_modifier.h [modify] https://crrev.com/f3d5b5224b62dda463a2dd55702c09eae50c1bc6/chrome/browser/extensions/scripting_permissions_modifier_unittest.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/23cd214fba4ed7ccfad450e53f6683dd428e58cc commit 23cd214fba4ed7ccfad450e53f6683dd428e58cc Author: Devlin Cronin <rdevlin.cronin@chromium.org> Date: Thu Jul 12 00:03:20 2018 [Extensions Click-to-Script] Remove granted hosts when changing access When transitioning from "on specific sites" to "on click", Chromium should remove specific granted sites from the extension. Do so, and add unittests for the same. Bug: 844128 Change-Id: Icfa6c1f6449e94e30560a10cf43163f2fcedd996 Reviewed-on: https://chromium-review.googlesource.com/1133775 Reviewed-by: Karan Bhatia <karandeepb@chromium.org> Commit-Queue: Devlin <rdevlin.cronin@chromium.org> Cr-Commit-Position: refs/heads/master@{#574420} [modify] https://crrev.com/23cd214fba4ed7ccfad450e53f6683dd428e58cc/chrome/browser/extensions/api/developer_private/developer_private_api.cc [modify] https://crrev.com/23cd214fba4ed7ccfad450e53f6683dd428e58cc/chrome/browser/extensions/api/developer_private/developer_private_api_unittest.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ffbd2fe229f69b29ff40ae861b513b5234d6eec0 commit ffbd2fe229f69b29ff40ae861b513b5234d6eec0 Author: Devlin Cronin <rdevlin.cronin@chromium.org> Date: Fri Jul 20 17:20:17 2018 [Extensions UI] Update the chrome://extensions page on permissions change Wire up the chrome://extensions page to listen for permissions changes, and dispatch the appropriate event. In addition to helping solve existing edge cases, this is necessary for the click-to-script management UI. Add unittests for the same, and fix some lifetime dependency issues. Bug: 844128 Cq-Include-Trybots: luci.chromium.try:closure_compilation Change-Id: I105dbb27f0d84e51081f521fcb5f9e32faead394 Reviewed-on: https://chromium-review.googlesource.com/1142382 Commit-Queue: Devlin <rdevlin.cronin@chromium.org> Reviewed-by: Karan Bhatia <karandeepb@chromium.org> Cr-Commit-Position: refs/heads/master@{#576907} [modify] https://crrev.com/ffbd2fe229f69b29ff40ae861b513b5234d6eec0/chrome/browser/extensions/api/developer_private/developer_private_api.cc [modify] https://crrev.com/ffbd2fe229f69b29ff40ae861b513b5234d6eec0/chrome/browser/extensions/api/developer_private/developer_private_api.h [modify] https://crrev.com/ffbd2fe229f69b29ff40ae861b513b5234d6eec0/chrome/browser/extensions/api/developer_private/developer_private_api_unittest.cc [modify] https://crrev.com/ffbd2fe229f69b29ff40ae861b513b5234d6eec0/chrome/browser/resources/md_extensions/manager.js [modify] https://crrev.com/ffbd2fe229f69b29ff40ae861b513b5234d6eec0/chrome/common/extensions/api/developer_private.idl [modify] https://crrev.com/ffbd2fe229f69b29ff40ae861b513b5234d6eec0/extensions/browser/BUILD.gn [modify] https://crrev.com/ffbd2fe229f69b29ff40ae861b513b5234d6eec0/extensions/browser/event_router.cc [modify] https://crrev.com/ffbd2fe229f69b29ff40ae861b513b5234d6eec0/extensions/browser/event_router.h [add] https://crrev.com/ffbd2fe229f69b29ff40ae861b513b5234d6eec0/extensions/browser/test_event_router_observer.cc [add] https://crrev.com/ffbd2fe229f69b29ff40ae861b513b5234d6eec0/extensions/browser/test_event_router_observer.h [modify] https://crrev.com/ffbd2fe229f69b29ff40ae861b513b5234d6eec0/third_party/closure_compiler/externs/developer_private.js
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/806ebde4b1c80581418e46c83ec635d989e6a403 commit 806ebde4b1c80581418e46c83ec635d989e6a403 Author: Devlin Cronin <rdevlin.cronin@chromium.org> Date: Fri Jul 20 20:30:53 2018 [Extensions Click-to-Script] Add a dialog to add new permitted hosts Add extensions-runtime-hosts-dialog to allow the user to enter a new host that the extension is allowed to run on, and wire it up in the chrome://extensions page. Add tests for the same. Note: this only allows for adding new hosts; a followup will allow for editing and removing current hosts. Bug: 844128 Cq-Include-Trybots: luci.chromium.try:closure_compilation Change-Id: Ib42d1c461700fcb2aa4a7b360f26619a6dcd65d3 Reviewed-on: https://chromium-review.googlesource.com/1136868 Commit-Queue: Devlin <rdevlin.cronin@chromium.org> Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org> Cr-Commit-Position: refs/heads/master@{#576970} [modify] https://crrev.com/806ebde4b1c80581418e46c83ec635d989e6a403/chrome/app/md_extensions_strings.grdp [modify] https://crrev.com/806ebde4b1c80581418e46c83ec635d989e6a403/chrome/browser/resources/md_extensions/BUILD.gn [modify] https://crrev.com/806ebde4b1c80581418e46c83ec635d989e6a403/chrome/browser/resources/md_extensions/detail_view.html [modify] https://crrev.com/806ebde4b1c80581418e46c83ec635d989e6a403/chrome/browser/resources/md_extensions/detail_view.js [modify] https://crrev.com/806ebde4b1c80581418e46c83ec635d989e6a403/chrome/browser/resources/md_extensions/extensions_resources.grd [modify] https://crrev.com/806ebde4b1c80581418e46c83ec635d989e6a403/chrome/browser/resources/md_extensions/item.js [add] https://crrev.com/806ebde4b1c80581418e46c83ec635d989e6a403/chrome/browser/resources/md_extensions/runtime_hosts_dialog.html [add] https://crrev.com/806ebde4b1c80581418e46c83ec635d989e6a403/chrome/browser/resources/md_extensions/runtime_hosts_dialog.js [modify] https://crrev.com/806ebde4b1c80581418e46c83ec635d989e6a403/chrome/browser/resources/md_extensions/service.js [modify] https://crrev.com/806ebde4b1c80581418e46c83ec635d989e6a403/chrome/browser/ui/webui/extensions/extensions_ui.cc [modify] https://crrev.com/806ebde4b1c80581418e46c83ec635d989e6a403/chrome/test/data/webui/extensions/cr_extensions_browsertest.js [add] https://crrev.com/806ebde4b1c80581418e46c83ec635d989e6a403/chrome/test/data/webui/extensions/extension_runtime_hosts_dialog_test.js [modify] https://crrev.com/806ebde4b1c80581418e46c83ec635d989e6a403/chrome/test/data/webui/extensions/test_service.js
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/37d98c4708ef50302adb9cd71a760dcf8e2a97c0 commit 37d98c4708ef50302adb9cd71a760dcf8e2a97c0 Author: Devlin Cronin <rdevlin.cronin@chromium.org> Date: Tue Jul 24 00:30:20 2018 [Extensions Click-to-Script] Pull out runtime host permissions element Create a custom element for the runtime host permissions controls in the chrome://extensions page, rather than having them defined in the DetailView element. This will make it easier to test and expand the controls. Pull the controls into runtime_host_permissions.[js|html], and extract the tests from extension_detail_view_test.js to extension_runtime_host_permisisons_test.js. Also add an additional test to verify the runtime host permissions dialog is shown when the 'add' button is clicked. There should be no visible UI changes as a result of this CL. Bug: 844128 Change-Id: I741adc921af95253087dbf31be1800c01fb4185c Reviewed-on: https://chromium-review.googlesource.com/1146999 Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org> Commit-Queue: Devlin <rdevlin.cronin@chromium.org> Cr-Commit-Position: refs/heads/master@{#577367} [modify] https://crrev.com/37d98c4708ef50302adb9cd71a760dcf8e2a97c0/chrome/browser/resources/md_extensions/BUILD.gn [modify] https://crrev.com/37d98c4708ef50302adb9cd71a760dcf8e2a97c0/chrome/browser/resources/md_extensions/detail_view.html [modify] https://crrev.com/37d98c4708ef50302adb9cd71a760dcf8e2a97c0/chrome/browser/resources/md_extensions/detail_view.js [modify] https://crrev.com/37d98c4708ef50302adb9cd71a760dcf8e2a97c0/chrome/browser/resources/md_extensions/extensions_resources.grd [add] https://crrev.com/37d98c4708ef50302adb9cd71a760dcf8e2a97c0/chrome/browser/resources/md_extensions/runtime_host_permissions.html [add] https://crrev.com/37d98c4708ef50302adb9cd71a760dcf8e2a97c0/chrome/browser/resources/md_extensions/runtime_host_permissions.js [modify] https://crrev.com/37d98c4708ef50302adb9cd71a760dcf8e2a97c0/chrome/browser/ui/webui/extensions/extensions_ui.cc [modify] https://crrev.com/37d98c4708ef50302adb9cd71a760dcf8e2a97c0/chrome/test/data/webui/extensions/cr_extensions_browsertest.js [modify] https://crrev.com/37d98c4708ef50302adb9cd71a760dcf8e2a97c0/chrome/test/data/webui/extensions/extension_detail_view_test.js [add] https://crrev.com/37d98c4708ef50302adb9cd71a760dcf8e2a97c0/chrome/test/data/webui/extensions/extension_runtime_host_permissions_test.js [modify] https://crrev.com/37d98c4708ef50302adb9cd71a760dcf8e2a97c0/chrome/test/data/webui/extensions/test_service.js
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/33cc887c227bb46f7601ac290844ca7892f5cb7b commit 33cc887c227bb46f7601ac290844ca7892f5cb7b Author: Devlin Cronin <rdevlin.cronin@chromium.org> Date: Wed Jul 25 22:24:37 2018 [Extensions Click-to-Script] Add editing of runtime host permissions Add the ability to edit or remove existing runtime host permissions in the chrome://extensions page. Reuse the existing runtime hosts dialog with extra information about a current entry, and add controls to trigger editing or removal of a current permission entry. Add JS tests for the same. Bug: 844128 Cq-Include-Trybots: luci.chromium.try:closure_compilation Change-Id: I0b1ad8bfcde167d6fa7c11a794ad04a8cb278e91 Reviewed-on: https://chromium-review.googlesource.com/1144532 Commit-Queue: Devlin <rdevlin.cronin@chromium.org> Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org> Cr-Commit-Position: refs/heads/master@{#578100} [modify] https://crrev.com/33cc887c227bb46f7601ac290844ca7892f5cb7b/chrome/app/md_extensions_strings.grdp [modify] https://crrev.com/33cc887c227bb46f7601ac290844ca7892f5cb7b/chrome/browser/resources/md_extensions/BUILD.gn [modify] https://crrev.com/33cc887c227bb46f7601ac290844ca7892f5cb7b/chrome/browser/resources/md_extensions/item.html [modify] https://crrev.com/33cc887c227bb46f7601ac290844ca7892f5cb7b/chrome/browser/resources/md_extensions/item.js [modify] https://crrev.com/33cc887c227bb46f7601ac290844ca7892f5cb7b/chrome/browser/resources/md_extensions/runtime_host_permissions.html [modify] https://crrev.com/33cc887c227bb46f7601ac290844ca7892f5cb7b/chrome/browser/resources/md_extensions/runtime_host_permissions.js [modify] https://crrev.com/33cc887c227bb46f7601ac290844ca7892f5cb7b/chrome/browser/resources/md_extensions/runtime_hosts_dialog.html [modify] https://crrev.com/33cc887c227bb46f7601ac290844ca7892f5cb7b/chrome/browser/resources/md_extensions/runtime_hosts_dialog.js [modify] https://crrev.com/33cc887c227bb46f7601ac290844ca7892f5cb7b/chrome/browser/resources/md_extensions/service.js [modify] https://crrev.com/33cc887c227bb46f7601ac290844ca7892f5cb7b/chrome/browser/ui/webui/extensions/extensions_ui.cc [modify] https://crrev.com/33cc887c227bb46f7601ac290844ca7892f5cb7b/chrome/test/data/webui/extensions/runtime_host_permissions_test.js [modify] https://crrev.com/33cc887c227bb46f7601ac290844ca7892f5cb7b/chrome/test/data/webui/extensions/runtime_hosts_dialog_test.js [modify] https://crrev.com/33cc887c227bb46f7601ac290844ca7892f5cb7b/chrome/test/data/webui/extensions/test_service.js
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/0d2fc4e4479a72ad97a3126ba9a216301a10b020 commit 0d2fc4e4479a72ad97a3126ba9a216301a10b020 Author: Devlin Cronin <rdevlin.cronin@chromium.org> Date: Wed Aug 22 23:15:31 2018 [Extensions Click-to-Script] Support URL patterns in the extensions page Rather than only displaying hosts, display the actual URLPatterns granted to an extension. Given this is a power-user surface, we can be a little less concerned with the technicality shown. Additionally, since we don't use a full string (e.g., "Read and change your data on all google.com sites"), we need to have the differentiation of which hosts the extension is granted, such as whether it includes subdomains. Also allow the user to enter patterns as an URLPattern (thus including subdomains if they so desire). Enforce that paths are always '*', since we don't use path-based permissions. To make it easier on users, also support just entering the host name (e.g., 'google.com'), which will be expanded to '*://google.com/*'. This also properly fixes the issue of clicking 'remove' or 'edit' on existing host options. Add JS tests for pattern validation, and update unittests to support pattern-based host manipulation. Bug: 844128 Change-Id: I599151bb6b89bdb113af4c39dcf0e21d152aa0fe Reviewed-on: https://chromium-review.googlesource.com/1166596 Commit-Queue: Devlin <rdevlin.cronin@chromium.org> Reviewed-by: Karan Bhatia <karandeepb@chromium.org> Reviewed-by: Steven Bennetts <stevenjb@chromium.org> Cr-Commit-Position: refs/heads/master@{#585299} [modify] https://crrev.com/0d2fc4e4479a72ad97a3126ba9a216301a10b020/chrome/browser/extensions/api/developer_private/developer_private_api.cc [modify] https://crrev.com/0d2fc4e4479a72ad97a3126ba9a216301a10b020/chrome/browser/extensions/api/developer_private/developer_private_api_unittest.cc [modify] https://crrev.com/0d2fc4e4479a72ad97a3126ba9a216301a10b020/chrome/browser/extensions/api/developer_private/extension_info_generator.cc [modify] https://crrev.com/0d2fc4e4479a72ad97a3126ba9a216301a10b020/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc [modify] https://crrev.com/0d2fc4e4479a72ad97a3126ba9a216301a10b020/chrome/browser/resources/md_extensions/runtime_hosts_dialog.js [modify] https://crrev.com/0d2fc4e4479a72ad97a3126ba9a216301a10b020/chrome/test/data/webui/extensions/runtime_hosts_dialog_test.js
Support is added. I'm going to close this out, and file separate bugs for follow-up work/enhancements to make tracking (and any potential merging) easier.
Comment 1 by bugdroid1@chromium.org
, May 22 2018