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

Issue 942533003: Enable <webview>.executeScript outside of Apps and Extensions [1] (Closed)

Created:
5 years, 10 months ago by Xi Han
Modified:
5 years, 9 months ago
CC:
chromium-reviews, extensions-reviews_chromium.org, je_julie(Not used), oshima+watch_chromium.org, plundblad+watch_chromium.org, aboxhall+watch_chromium.org, nektar+watch_chromium.org, yuzo+watch_chromium.org, dmazzoni+watch_chromium.org, dtseng+watch_chromium.org, chromium-apps-reviews_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org, xiyuan
Base URL:
https://chromium.googlesource.com/chromium/src.git@decouple_brower_isolated_world_routingid_user_script_UserScriptSet_non_hostset_2
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Enable <webview>.executeScript outside of Apps and Extensions [1] This patch enables javascript code injection like <webview>.executeScript({code: ...}), but does not include file injection like <webview>.executeScript({file: ...}). File injection will be in another patch. BUG=434081 Committed: https://crrev.com/79f7a57302cae3f7afcd53c6dff542e32bada999 Cr-Commit-Position: refs/heads/master@{#319727}

Patch Set 1 : #

Total comments: 2

Patch Set 2 : nits. #

Total comments: 10

Patch Set 3 : nits. #

Patch Set 4 : #

Total comments: 4

Patch Set 5 : IPC message updated. #

Patch Set 6 : Rebase. #

Patch Set 7 : Add a test. #

Total comments: 10

Patch Set 8 : nits #

Patch Set 9 : nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+189 lines, -34 lines) Patch
M chrome/browser/chromeos/accessibility/accessibility_manager.cc View 1 2 3 4 5 3 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/tabs/tabs_api.cc View 1 2 3 3 chunks +3 lines, -1 line 0 comments Download
A chrome/browser/ui/webui/webui_webview_browsertest.cc View 1 2 3 4 5 6 1 chunk +46 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/webui/webview_execute_script_test.js View 1 2 3 4 5 6 7 8 1 chunk +32 lines, -0 lines 0 comments Download
M extensions/browser/api/execute_code_function.h View 1 2 3 3 chunks +9 lines, -0 lines 0 comments Download
M extensions/browser/api/execute_code_function.cc View 1 2 3 4 3 chunks +6 lines, -2 lines 0 comments Download
M extensions/browser/api/web_view/web_view_internal_api.cc View 1 2 3 4 1 chunk +13 lines, -1 line 0 comments Download
M extensions/browser/script_executor.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M extensions/browser/script_executor.cc View 1 2 3 4 5 chunks +17 lines, -12 lines 0 comments Download
M extensions/common/extension_messages.h View 1 2 3 4 4 chunks +13 lines, -3 lines 0 comments Download
M extensions/common/extension_messages.cc View 1 2 3 4 1 chunk +24 lines, -0 lines 0 comments Download
M extensions/common/host_id.h View 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/extension_injection_host.h View 1 2 chunks +4 lines, -2 lines 0 comments Download
M extensions/renderer/extension_injection_host.cc View 1 2 3 4 1 chunk +3 lines, -2 lines 0 comments Download
M extensions/renderer/programmatic_script_injector.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M extensions/renderer/script_injection_manager.cc View 1 2 3 4 5 2 chunks +12 lines, -6 lines 0 comments Download
M extensions/renderer/web_ui_injection_host.cc View 1 2 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 33 (11 generated)
Xi Han
5 years, 10 months ago (2015-02-19 19:49:07 UTC) #4
Fady Samuel
https://codereview.chromium.org/942533003/diff/40001/extensions/renderer/programmatic_script_injector.cc File extensions/renderer/programmatic_script_injector.cc (right): https://codereview.chromium.org/942533003/diff/40001/extensions/renderer/programmatic_script_injector.cc#newcode87 extensions/renderer/programmatic_script_injector.cc:87: return PermissionsData::ACCESS_DENIED; I'm confused by this, doesn't this disable ...
5 years, 10 months ago (2015-02-19 19:52:55 UTC) #5
Xi Han
https://codereview.chromium.org/942533003/diff/40001/extensions/renderer/programmatic_script_injector.cc File extensions/renderer/programmatic_script_injector.cc (right): https://codereview.chromium.org/942533003/diff/40001/extensions/renderer/programmatic_script_injector.cc#newcode87 extensions/renderer/programmatic_script_injector.cc:87: return PermissionsData::ACCESS_DENIED; On 2015/02/19 19:52:54, Fady Samuel wrote: > ...
5 years, 10 months ago (2015-02-19 19:56:04 UTC) #6
Fady Samuel
Ohh I see. lgtm, but I'm not really the right person to review this. Please ...
5 years, 10 months ago (2015-02-23 17:03:23 UTC) #7
Xi Han
Fady: I remove the check and add a DCHECK there, hopefully the code looks better ...
5 years, 10 months ago (2015-02-23 17:26:36 UTC) #11
Devlin
If this patch is all it takes to make webui able to use executeScript, then ...
5 years, 10 months ago (2015-02-25 17:22:36 UTC) #12
Xi Han
Hi Devlin: please review other changes first. I will introduce a test for this patch ...
5 years, 10 months ago (2015-02-26 15:13:45 UTC) #13
Devlin
https://codereview.chromium.org/942533003/diff/80001/extensions/browser/api/execute_code_function.cc File extensions/browser/api/execute_code_function.cc (right): https://codereview.chromium.org/942533003/diff/80001/extensions/browser/api/execute_code_function.cc#newcode39 extensions/browser/api/execute_code_function.cc:39: : host_id_(new HostID()) { On 2015/02/26 15:13:45, Xi Han ...
5 years, 10 months ago (2015-02-26 17:35:24 UTC) #14
Xi Han
PTAL, thanks! https://codereview.chromium.org/942533003/diff/80001/extensions/browser/api/execute_code_function.cc File extensions/browser/api/execute_code_function.cc (right): https://codereview.chromium.org/942533003/diff/80001/extensions/browser/api/execute_code_function.cc#newcode39 extensions/browser/api/execute_code_function.cc:39: : host_id_(new HostID()) { On 2015/02/26 17:35:24, ...
5 years, 10 months ago (2015-02-26 19:58:00 UTC) #15
Devlin
Couple of small things, but really just waiting on a test. https://codereview.chromium.org/942533003/diff/120001/extensions/browser/api/web_view/web_view_internal_api.cc File extensions/browser/api/web_view/web_view_internal_api.cc (right): ...
5 years, 9 months ago (2015-02-27 17:11:36 UTC) #16
Xi Han
Hi Devlin: I update the IPC message to contain HostID now, PTAL, thanks! https://codereview.chromium.org/942533003/diff/120001/extensions/browser/api/web_view/web_view_internal_api.cc File ...
5 years, 9 months ago (2015-02-27 21:07:46 UTC) #17
Devlin
On 2015/02/27 21:07:46, Xi Han wrote: > Hi Devlin: I update the IPC message to ...
5 years, 9 months ago (2015-02-27 21:50:40 UTC) #18
Xi Han
Thanks for xiyuan@'s help, a test is added to call webview.executeScript on webUI, PTAL, thanks!
5 years, 9 months ago (2015-03-06 23:07:45 UTC) #20
xiyuan
webui/* LGTM
5 years, 9 months ago (2015-03-07 04:40:28 UTC) #22
Devlin
lgtm with nits https://codereview.chromium.org/942533003/diff/200001/chrome/test/data/webui/webview_execute_script_test.js File chrome/test/data/webui/webview_execute_script_test.js (right): https://codereview.chromium.org/942533003/diff/200001/chrome/test/data/webui/webview_execute_script_test.js#newcode20 chrome/test/data/webui/webview_execute_script_test.js:20: code: 'document.body.style.backgroundColor' nit: add a semicolon. ...
5 years, 9 months ago (2015-03-09 16:04:42 UTC) #23
Xi Han
kenrb@chromium.org: Please review changes in -extensions/common/extension_messages.h -extensions/common/extension_messages.cc. Thanks! https://codereview.chromium.org/942533003/diff/200001/chrome/test/data/webui/webview_execute_script_test.js File chrome/test/data/webui/webview_execute_script_test.js (right): https://codereview.chromium.org/942533003/diff/200001/chrome/test/data/webui/webview_execute_script_test.js#newcode20 chrome/test/data/webui/webview_execute_script_test.js:20: code: ...
5 years, 9 months ago (2015-03-09 17:59:56 UTC) #25
Devlin
https://codereview.chromium.org/942533003/diff/200001/chrome/test/data/webui/webview_execute_script_test.js File chrome/test/data/webui/webview_execute_script_test.js (right): https://codereview.chromium.org/942533003/diff/200001/chrome/test/data/webui/webview_execute_script_test.js#newcode20 chrome/test/data/webui/webview_execute_script_test.js:20: code: 'document.body.style.backgroundColor' On 2015/03/09 17:59:56, Xi Han wrote: > ...
5 years, 9 months ago (2015-03-09 18:07:59 UTC) #26
Xi Han
https://codereview.chromium.org/942533003/diff/200001/chrome/test/data/webui/webview_execute_script_test.js File chrome/test/data/webui/webview_execute_script_test.js (right): https://codereview.chromium.org/942533003/diff/200001/chrome/test/data/webui/webview_execute_script_test.js#newcode20 chrome/test/data/webui/webview_execute_script_test.js:20: code: 'document.body.style.backgroundColor' On 2015/03/09 18:07:59, Devlin wrote: > On ...
5 years, 9 months ago (2015-03-09 18:28:33 UTC) #27
kenrb
ipc lgtm
5 years, 9 months ago (2015-03-09 19:36:25 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/942533003/240001
5 years, 9 months ago (2015-03-09 20:21:36 UTC) #31
commit-bot: I haz the power
Committed patchset #9 (id:240001)
5 years, 9 months ago (2015-03-09 20:47:14 UTC) #32
commit-bot: I haz the power
5 years, 9 months ago (2015-03-09 20:49:51 UTC) #33
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/79f7a57302cae3f7afcd53c6dff542e32bada999
Cr-Commit-Position: refs/heads/master@{#319727}

Powered by Google App Engine
This is Rietveld 408576698