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

Issue 498513002: Respect the clipboardRead and clipboardWrite permissions in content scripts. (Closed)

Created:
6 years, 4 months ago by Marijn Kruisselbrink
Modified:
6 years, 3 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, dcheng, extensions-reviews_chromium.org, not at google - send to devlin
Project:
chromium
Visibility:
Public.

Description

Respect the clipboardRead and clipboardWrite permissions in content scripts. Added an extra "effective extension" property to ScriptContext for this to still work correctly in about:blank iframes inside extension pages. BUG=395376 Committed: https://crrev.com/7e1d745456f66b1d32df236e285a849c8d69db00 Cr-Commit-Position: refs/heads/master@{#293818}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : add effective extension to script context #

Patch Set 4 : fix extensions test compile #

Total comments: 27

Patch Set 5 : address comments #

Total comments: 6

Patch Set 6 : address more comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+453 lines, -157 lines) Patch
M chrome/browser/renderer_host/chrome_extension_message_filter.h View 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/renderer_host/chrome_extension_message_filter.cc View 1 2 3 4 3 chunks +0 lines, -21 lines 0 comments Download
M chrome/common/extensions/chrome_extension_messages.h View 1 2 1 chunk +0 lines, -8 lines 0 comments Download
M chrome/renderer/content_settings_observer.h View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/renderer/content_settings_observer.cc View 1 2 3 4 5 3 chunks +27 lines, -7 lines 0 comments Download
M chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.h View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc View 1 2 1 chunk +10 lines, -3 lines 0 comments Download
M chrome/renderer/extensions/chrome_v8_context.h View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M chrome/renderer/extensions/chrome_v8_context.cc View 1 2 1 chunk +9 lines, -2 lines 0 comments Download
A chrome/test/data/extensions/api_test/clipboard/extension/content_script.js View 1 2 3 4 5 1 chunk +34 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/api_test/clipboard/extension/manifest.json View 1 2 3 4 5 1 chunk +7 lines, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/clipboard/extension/test.js View 1 2 3 4 5 2 chunks +91 lines, -26 lines 0 comments Download
A chrome/test/data/extensions/api_test/clipboard/extension_no_permission/content_script.js View 1 2 3 4 5 1 chunk +34 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/api_test/clipboard/extension_no_permission/manifest.json View 1 2 3 4 5 1 chunk +8 lines, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/clipboard/extension_no_permission/test.js View 1 2 3 4 5 2 chunks +94 lines, -26 lines 0 comments Download
M extensions/renderer/default_dispatcher_delegate.h View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M extensions/renderer/default_dispatcher_delegate.cc View 1 2 1 chunk +9 lines, -3 lines 0 comments Download
M extensions/renderer/dispatcher.h View 1 2 3 4 1 chunk +4 lines, -2 lines 0 comments Download
M extensions/renderer/dispatcher.cc View 1 2 3 4 5 2 chunks +43 lines, -27 lines 0 comments Download
M extensions/renderer/dispatcher_delegate.h View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M extensions/renderer/module_system_test.cc View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/renderer/script_context.h View 1 2 3 4 4 chunks +22 lines, -1 line 0 comments Download
M extensions/renderer/script_context.cc View 1 2 3 4 5 2 chunks +43 lines, -21 lines 0 comments Download
M extensions/renderer/script_context_set_unittest.cc View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/renderer/v8_schema_registry.cc View 1 2 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (4 generated)
Marijn Kruisselbrink
This is a fixed version of what kalman@ started in https://codereview.chromium.org/475883003/. The original CL had ...
6 years, 3 months ago (2014-09-03 19:32:29 UTC) #2
Devlin
https://codereview.chromium.org/498513002/diff/80001/chrome/browser/renderer_host/chrome_extension_message_filter.cc File chrome/browser/renderer_host/chrome_extension_message_filter.cc (right): https://codereview.chromium.org/498513002/diff/80001/chrome/browser/renderer_host/chrome_extension_message_filter.cc#newcode26 chrome/browser/renderer_host/chrome_extension_message_filter.cc:26: #include "extensions/common/constants.h" It also _looks_ like you don't need ...
6 years, 3 months ago (2014-09-03 22:09:17 UTC) #3
Marijn Kruisselbrink
PTAL and adding rockot@ just in case he has an opinion on this as well, ...
6 years, 3 months ago (2014-09-03 23:54:07 UTC) #5
Devlin
lgtm with nits https://codereview.chromium.org/498513002/diff/80001/chrome/test/data/extensions/api_test/clipboard/extension/test.js File chrome/test/data/extensions/api_test/clipboard/extension/test.js (right): https://codereview.chromium.org/498513002/diff/80001/chrome/test/data/extensions/api_test/clipboard/extension/test.js#newcode58 chrome/test/data/extensions/api_test/clipboard/extension/test.js:58: chrome.tabs.executeScript(tabId, {file: 'content_script.js'}); On 2014/09/03 23:54:07, ...
6 years, 3 months ago (2014-09-04 19:15:11 UTC) #6
Marijn Kruisselbrink
https://codereview.chromium.org/498513002/diff/80001/chrome/test/data/extensions/api_test/clipboard/extension/test.js File chrome/test/data/extensions/api_test/clipboard/extension/test.js (right): https://codereview.chromium.org/498513002/diff/80001/chrome/test/data/extensions/api_test/clipboard/extension/test.js#newcode58 chrome/test/data/extensions/api_test/clipboard/extension/test.js:58: chrome.tabs.executeScript(tabId, {file: 'content_script.js'}); On 2014/09/04 19:15:10, Devlin wrote: > ...
6 years, 3 months ago (2014-09-04 23:41:11 UTC) #7
Marijn Kruisselbrink
adding OWNERS reviewers: +thestig for chrome/browser/renderer_host/chrome_extension_message_filter.* and chrome/renderer/content_settings_observer.* +jln for chrome/common/extensions/chrome_extension_messages.h
6 years, 3 months ago (2014-09-04 23:50:13 UTC) #9
Lei Zhang
lgtm
6 years, 3 months ago (2014-09-05 00:03:10 UTC) #10
Ken Rockot(use gerrit already)
lgtm as well
6 years, 3 months ago (2014-09-05 00:11:12 UTC) #11
jln (very slow on Chromium)
chrome/common/extensions/chrome_extension_messages.h lgtm
6 years, 3 months ago (2014-09-08 19:09:09 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mek@chromium.org/498513002/120001
6 years, 3 months ago (2014-09-08 19:23:49 UTC) #14
commit-bot: I haz the power
Committed patchset #6 (id:120001) as 8c040ea2a6b36cd0d9719370c30c1daacd4b4879
6 years, 3 months ago (2014-09-09 00:27:25 UTC) #15
commit-bot: I haz the power
6 years, 3 months ago (2014-09-10 03:49:09 UTC) #16
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/7e1d745456f66b1d32df236e285a849c8d69db00
Cr-Commit-Position: refs/heads/master@{#293818}

Powered by Google App Engine
This is Rietveld 408576698