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

Issue 1628423002: Add frameId to chrome.tabs.executeScript/insertCSS (Closed)

Created:
4 years, 11 months ago by robwu
Modified:
4 years, 10 months ago
Reviewers:
Devlin, jam, nasko
CC:
chromium-reviews, extensions-reviews_chromium.org, creis+watch_chromium.org, oshima+watch_chromium.org, plundblad+watch_chromium.org, aboxhall+watch_chromium.org, nasko+codewatch_chromium.org, nektar+watch_chromium.org, yuzo+watch_chromium.org, je_julie, darin-cc_chromium.org, dmazzoni+watch_chromium.org, dtseng+watch_chromium.org, chromium-apps-reviews_chromium.org, davemoore+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@permissiondata-remove-process_id
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add frameId to chrome.tabs.executeScript/insertCSS - Re-implemented https://codereview.chromium.org/952473002/, with all checks at the browser side instead of just the renderer. - Use the last committed URL for checking permissions instead of the visible URL. As a result, executeScript/insertCSS will now succeed in frames where the currently committed page is scriptable by extensions, but the target of the pending navigation is is not. - ExecuteScript: Do not send IPC to non-live frames (they're not going to reply anyway). - Include URL in the error if the extension has the tabs permission (follow-up to TODO from https://codereview.chromium.org/1414223005). BUG=63979, 551626 TEST=./browser_tests --gtest_filter=ExecuteScriptApiTest.* CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/52277c872b368db45bc6d2f2bd9a4b7a0eb2ce8d Cr-Commit-Position: refs/heads/master@{#374057}

Patch Set 1 #

Patch Set 2 : Revert to wc->GetURL for chrome.tabs.update #

Total comments: 12

Patch Set 3 : Nits + comments #

Total comments: 26

Patch Set 4 : Devlins nits #

Patch Set 5 : Remove RenderFrameHost::ForEachChildFrame #

Total comments: 6

Patch Set 6 : Last nits #

Patch Set 7 : rebase #

Patch Set 8 : Remove unused include from rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+608 lines, -79 lines) Patch
M chrome/browser/chromeos/accessibility/accessibility_manager.cc View 1 2 3 4 5 6 2 chunks +16 lines, -14 lines 0 comments Download
M chrome/browser/extensions/api/tabs/tabs_api.cc View 1 2 3 4 5 6 3 chunks +41 lines, -8 lines 0 comments Download
M chrome/browser/extensions/api/tabs/tabs_constants.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/api/tabs/tabs_constants.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/execute_script_apitest.cc View 1 2 3 4 5 6 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/api_test/executescript/basic/test.js View 2 chunks +9 lines, -2 lines 0 comments Download
A chrome/test/data/extensions/api_test/executescript/frame_id/frame.html View 1 chunk +3 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/executescript/frame_id/frames.html View 1 chunk +11 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/executescript/frame_id/manifest.json View 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/executescript/frame_id/nested.html View 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/executescript/frame_id/test.js View 1 2 3 1 chunk +383 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/api_test/executescript/navigation_race/test.js View 1 chunk +4 lines, -3 lines 0 comments Download
M extensions/browser/api/execute_code_function.cc View 1 2 3 3 chunks +9 lines, -12 lines 0 comments Download
M extensions/browser/extension_api_frame_id_map.h View 1 chunk +3 lines, -0 lines 0 comments Download
M extensions/browser/extension_api_frame_id_map.cc View 3 chunks +3 lines, -2 lines 0 comments Download
M extensions/browser/script_executor.h View 1 2 3 4 5 3 chunks +7 lines, -2 lines 0 comments Download
M extensions/browser/script_executor.cc View 1 2 3 4 5 9 chunks +61 lines, -21 lines 0 comments Download
M extensions/common/api/extension_types.json View 1 2 1 chunk +11 lines, -1 line 0 comments Download
M extensions/renderer/programmatic_script_injector.h View 2 chunks +6 lines, -4 lines 0 comments Download
M extensions/renderer/programmatic_script_injector.cc View 1 2 3 4 5 6 7 4 chunks +23 lines, -10 lines 0 comments Download

Messages

Total messages: 46 (17 generated)
robwu
jam: content/ devlin: The rest.
4 years, 11 months ago (2016-01-25 18:35:20 UTC) #4
Devlin
I haven't made it through the tests yet, but this looks generally good. https://codereview.chromium.org/1628423002/diff/20001/chrome/test/data/extensions/api_test/executescript/frame_id/test.js File ...
4 years, 11 months ago (2016-01-25 19:36:40 UTC) #5
robwu
https://codereview.chromium.org/1628423002/diff/20001/chrome/test/data/extensions/api_test/executescript/frame_id/test.js File chrome/test/data/extensions/api_test/executescript/frame_id/test.js (right): https://codereview.chromium.org/1628423002/diff/20001/chrome/test/data/extensions/api_test/executescript/frame_id/test.js#newcode18 chrome/test/data/extensions/api_test/executescript/frame_id/test.js:18: var id_frame_top = 0; On 2016/01/25 19:36:40, Devlin (Slow ...
4 years, 11 months ago (2016-01-26 11:03:02 UTC) #6
Devlin
lgtm with nits. https://codereview.chromium.org/1628423002/diff/20001/extensions/renderer/programmatic_script_injector.cc File extensions/renderer/programmatic_script_injector.cc (right): https://codereview.chromium.org/1628423002/diff/20001/extensions/renderer/programmatic_script_injector.cc#newcode161 extensions/renderer/programmatic_script_injector.cc:161: return extension->permissions_data()->active_permissions().HasAPIPermission( On 2016/01/26 11:03:02, robwu ...
4 years, 11 months ago (2016-01-26 20:40:36 UTC) #7
jam
Nasko: is this public API something we want to support ? https://codereview.chromium.org/1628423002/diff/40001/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (right): ...
4 years, 11 months ago (2016-01-26 23:42:34 UTC) #9
robwu
https://codereview.chromium.org/1628423002/diff/20001/extensions/renderer/programmatic_script_injector.cc File extensions/renderer/programmatic_script_injector.cc (right): https://codereview.chromium.org/1628423002/diff/20001/extensions/renderer/programmatic_script_injector.cc#newcode161 extensions/renderer/programmatic_script_injector.cc:161: return extension->permissions_data()->active_permissions().HasAPIPermission( On 2016/01/26 20:40:36, Devlin (Slow until 1-27) ...
4 years, 11 months ago (2016-01-26 23:57:59 UTC) #10
nasko
On 2016/01/26 23:42:34, jam wrote: > Nasko: is this public API something we want to ...
4 years, 11 months ago (2016-01-27 18:24:33 UTC) #11
Devlin
https://codereview.chromium.org/1628423002/diff/40001/chrome/test/data/extensions/api_test/executescript/basic/test.js File chrome/test/data/extensions/api_test/executescript/basic/test.js (right): https://codereview.chromium.org/1628423002/diff/40001/chrome/test/data/extensions/api_test/executescript/basic/test.js#newcode91 chrome/test/data/extensions/api_test/executescript/basic/test.js:91: var doneListening = On 2016/01/26 23:57:58, robwu wrote: > ...
4 years, 11 months ago (2016-01-27 18:33:48 UTC) #12
robwu
On 2016/01/27 18:24:33, nasko wrote: > On 2016/01/26 23:42:34, jam wrote: > > Nasko: is ...
4 years, 11 months ago (2016-01-27 19:15:03 UTC) #13
nasko
On 2016/01/27 19:15:03, robwu wrote: > On 2016/01/27 18:24:33, nasko wrote: > > On 2016/01/26 ...
4 years, 11 months ago (2016-01-27 19:20:50 UTC) #14
robwu
On 2016/01/27 19:20:50, nasko wrote: > On 2016/01/27 19:15:03, robwu wrote: > > On 2016/01/27 ...
4 years, 11 months ago (2016-01-28 00:54:28 UTC) #15
nasko
On 2016/01/28 00:54:28, robwu wrote: > On 2016/01/27 19:20:50, nasko wrote: > > On 2016/01/27 ...
4 years, 10 months ago (2016-01-28 23:15:13 UTC) #16
robwu
On 2016/01/28 23:15:13, nasko wrote: > On 2016/01/28 00:54:28, robwu wrote: > > On 2016/01/27 ...
4 years, 10 months ago (2016-01-28 23:38:51 UTC) #17
nasko
On 2016/01/28 23:38:51, robwu wrote: > On 2016/01/28 23:15:13, nasko wrote: > > On 2016/01/28 ...
4 years, 10 months ago (2016-01-28 23:54:36 UTC) #18
robwu
On 2016/01/28 23:54:36, nasko wrote: > On 2016/01/28 23:38:51, robwu wrote: > > Do you ...
4 years, 10 months ago (2016-01-30 16:58:29 UTC) #22
Devlin
s lgtm https://codereview.chromium.org/1628423002/diff/100001/extensions/browser/script_executor.cc File extensions/browser/script_executor.cc (right): https://codereview.chromium.org/1628423002/diff/100001/extensions/browser/script_executor.cc#newcode110 extensions/browser/script_executor.cc:110: DCHECK(ShouldIncludeFrame(frame)); Ah, DCHECKS. So, I get worried ...
4 years, 10 months ago (2016-02-01 19:04:07 UTC) #23
nasko
Since there isn't any content/ code, you don't technically need my review. I read through ...
4 years, 10 months ago (2016-02-01 21:32:46 UTC) #24
robwu
https://codereview.chromium.org/1628423002/diff/100001/extensions/browser/script_executor.cc File extensions/browser/script_executor.cc (right): https://codereview.chromium.org/1628423002/diff/100001/extensions/browser/script_executor.cc#newcode110 extensions/browser/script_executor.cc:110: DCHECK(ShouldIncludeFrame(frame)); On 2016/02/01 19:04:07, Devlin wrote: > Ah, DCHECKS. ...
4 years, 10 months ago (2016-02-01 23:17:45 UTC) #25
Devlin
https://codereview.chromium.org/1628423002/diff/100001/extensions/browser/script_executor.cc File extensions/browser/script_executor.cc (right): https://codereview.chromium.org/1628423002/diff/100001/extensions/browser/script_executor.cc#newcode110 extensions/browser/script_executor.cc:110: DCHECK(ShouldIncludeFrame(frame)); On 2016/02/01 23:17:44, robwu wrote: > On 2016/02/01 ...
4 years, 10 months ago (2016-02-01 23:28:13 UTC) #26
robwu
https://codereview.chromium.org/1628423002/diff/100001/extensions/browser/script_executor.cc File extensions/browser/script_executor.cc (right): https://codereview.chromium.org/1628423002/diff/100001/extensions/browser/script_executor.cc#newcode110 extensions/browser/script_executor.cc:110: DCHECK(ShouldIncludeFrame(frame)); On 2016/02/01 23:28:13, Devlin wrote: > On 2016/02/01 ...
4 years, 10 months ago (2016-02-02 15:28:19 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1628423002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1628423002/120001
4 years, 10 months ago (2016-02-02 15:29:06 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/141614)
4 years, 10 months ago (2016-02-02 15:51:05 UTC) #32
robwu
+jam Please rubberstamp chrome/browser/chromeos/accessibility/accessibility_manager.cc
4 years, 10 months ago (2016-02-02 15:55:09 UTC) #34
jam
On 2016/02/02 15:55:09, robwu wrote: > +jam > Please rubberstamp > chrome/browser/chromeos/accessibility/accessibility_manager.cc lgtm in the ...
4 years, 10 months ago (2016-02-05 22:37:40 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1628423002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1628423002/120001
4 years, 10 months ago (2016-02-07 15:04:01 UTC) #37
commit-bot: I haz the power
Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/127575) ios_rel_device_ninja on tryserver.chromium.mac (JOB_FAILED, ...
4 years, 10 months ago (2016-02-07 15:05:55 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1628423002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1628423002/160001
4 years, 10 months ago (2016-02-07 15:17:55 UTC) #42
commit-bot: I haz the power
Committed patchset #8 (id:160001)
4 years, 10 months ago (2016-02-07 17:29:07 UTC) #44
commit-bot: I haz the power
4 years, 10 months ago (2016-02-07 17:30:31 UTC) #46
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/52277c872b368db45bc6d2f2bd9a4b7a0eb2ce8d
Cr-Commit-Position: refs/heads/master@{#374057}

Powered by Google App Engine
This is Rietveld 408576698