Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Issue 313453002: Resubmit: Block content scripts from executing until user grants permission (Closed)

Created:
6 years, 6 months ago by Devlin
Modified:
6 years, 6 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Visibility:
Public.

Description

Resubmit: Block content scripts from executing until user grants permission Original CL: https://codereview.chromium.org/288053002/ Original Description: Prevent extensions with <all_urls> from running content scripts without user consent if the scripts-require-action switch is on. ----------------------------------------------- This had a problem in that when user scripts are updated, the old versions are invalidated (as they rely on StringPieces, which do not actually own content). Fix is to update all user scripts, even if they didn't actually change. Also add in ActiveScriptController removing actions for unloaded extensions. TBR=jschuh@chromium.org (for extension_messages.h, no change from original patch) BUG=362353 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=274659

Patch Set 1 : Original Patch #

Patch Set 2 : Fix #

Total comments: 4

Patch Set 3 : Tests #

Total comments: 5

Patch Set 4 : #

Patch Set 5 : Latest master #

Unified diffs Side-by-side diffs Delta from patch set Stats (+654 lines, -122 lines) Patch
M chrome/browser/chrome_content_browser_client.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/active_script_controller.h View 1 2 3 3 chunks +9 lines, -4 lines 0 comments Download
M chrome/browser/extensions/active_script_controller.cc View 1 2 3 4 chunks +43 lines, -10 lines 0 comments Download
M chrome/browser/extensions/active_script_controller_browsertest.cc View 1 2 3 7 chunks +114 lines, -24 lines 0 comments Download
M chrome/browser/extensions/location_bar_controller.h View 1 2 3 5 chunks +20 lines, -1 line 0 comments Download
M chrome/browser/extensions/location_bar_controller.cc View 1 2 3 2 chunks +22 lines, -1 line 0 comments Download
M chrome/browser/extensions/page_action_controller.h View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/extensions/user_script_master.h View 2 chunks +10 lines, -2 lines 0 comments Download
M chrome/browser/extensions/user_script_master.cc View 6 chunks +19 lines, -7 lines 0 comments Download
M chrome/common/extensions/manifest_handlers/content_scripts_handler.cc View 1 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/common/extensions/manifest_handlers/content_scripts_manifest_unittest.cc View 1 2 1 chunk +16 lines, -0 lines 0 comments Download
M extensions/common/extension_messages.h View 1 2 3 4 2 chunks +19 lines, -4 lines 0 comments Download
M extensions/common/permissions/permissions_data.cc View 1 chunk +4 lines, -3 lines 0 comments Download
M extensions/common/user_script.h View 1 4 chunks +10 lines, -0 lines 0 comments Download
M extensions/common/user_script.cc View 1 3 chunks +3 lines, -0 lines 0 comments Download
M extensions/common/user_script_unittest.cc View 1 2 3 chunks +9 lines, -0 lines 0 comments Download
M extensions/renderer/dispatcher.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M extensions/renderer/dispatcher.cc View 1 2 3 4 1 chunk +18 lines, -3 lines 0 comments Download
M extensions/renderer/extension_helper.h View 1 chunk +1 line, -0 lines 0 comments Download
M extensions/renderer/extension_helper.cc View 3 chunks +10 lines, -1 line 0 comments Download
M extensions/renderer/script_injection.h View 1 2 6 chunks +48 lines, -11 lines 0 comments Download
M extensions/renderer/script_injection.cc View 1 4 chunks +155 lines, -0 lines 0 comments Download
M extensions/renderer/user_script_slave.h View 2 chunks +13 lines, -1 line 0 comments Download
M extensions/renderer/user_script_slave.cc View 1 2 6 chunks +104 lines, -46 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Devlin
6 years, 6 months ago (2014-06-02 18:31:23 UTC) #1
not at google - send to devlin
https://codereview.chromium.org/313453002/diff/20001/chrome/common/extensions/manifest_handlers/content_scripts_handler.cc File chrome/common/extensions/manifest_handlers/content_scripts_handler.cc (right): https://codereview.chromium.org/313453002/diff/20001/chrome/common/extensions/manifest_handlers/content_scripts_handler.cc#newcode430 chrome/common/extensions/manifest_handlers/content_scripts_handler.cc:430: user_script.set_id(g_next_user_script_id++); is there a test for ContentScriptsHandler that we ...
6 years, 6 months ago (2014-06-02 18:42:55 UTC) #2
Devlin
Also added an id-pickling test for user script, and, more importantly, a test for removing ...
6 years, 6 months ago (2014-06-02 21:04:30 UTC) #3
not at google - send to devlin
lgtm with a couple of minor changes https://codereview.chromium.org/313453002/diff/40001/chrome/browser/extensions/active_script_controller.cc File chrome/browser/extensions/active_script_controller.cc (right): https://codereview.chromium.org/313453002/diff/40001/chrome/browser/extensions/active_script_controller.cc#newcode285 chrome/browser/extensions/active_script_controller.cc:285: pending_requests_.erase(iter); seems ...
6 years, 6 months ago (2014-06-02 21:28:17 UTC) #4
Devlin
https://codereview.chromium.org/313453002/diff/40001/chrome/browser/extensions/active_script_controller_browsertest.cc File chrome/browser/extensions/active_script_controller_browsertest.cc (right): https://codereview.chromium.org/313453002/diff/40001/chrome/browser/extensions/active_script_controller_browsertest.cc#newcode425 chrome/browser/extensions/active_script_controller_browsertest.cc:425: inject_success_listener.WaitUntilSatisfied(); On 2014/06/02 21:28:17, kalman wrote: > it doesn't ...
6 years, 6 months ago (2014-06-02 22:19:15 UTC) #5
not at google - send to devlin
https://codereview.chromium.org/313453002/diff/40001/chrome/browser/extensions/active_script_controller_browsertest.cc File chrome/browser/extensions/active_script_controller_browsertest.cc (right): https://codereview.chromium.org/313453002/diff/40001/chrome/browser/extensions/active_script_controller_browsertest.cc#newcode425 chrome/browser/extensions/active_script_controller_browsertest.cc:425: inject_success_listener.WaitUntilSatisfied(); On 2014/06/02 22:19:16, Devlin wrote: > On 2014/06/02 ...
6 years, 6 months ago (2014-06-02 22:20:19 UTC) #6
Devlin
https://codereview.chromium.org/313453002/diff/40001/chrome/browser/extensions/active_script_controller.cc File chrome/browser/extensions/active_script_controller.cc (right): https://codereview.chromium.org/313453002/diff/40001/chrome/browser/extensions/active_script_controller.cc#newcode285 chrome/browser/extensions/active_script_controller.cc:285: pending_requests_.erase(iter); On 2014/06/02 21:28:17, kalman wrote: > seems like ...
6 years, 6 months ago (2014-06-02 23:07:52 UTC) #7
Devlin
The CQ bit was checked by rdevlin.cronin@chromium.org
6 years, 6 months ago (2014-06-03 19:05:44 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rdevlin.cronin@chromium.org/313453002/80001
6 years, 6 months ago (2014-06-03 19:07:42 UTC) #9
commit-bot: I haz the power
6 years, 6 months ago (2014-06-03 22:41:06 UTC) #10
Message was sent while issue was closed.
Change committed as 274659

Powered by Google App Engine
This is Rietveld 408576698