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

Issue 2471553003: Fix content script injection not working with PlzNavigate because of different navigation timings. (Closed)

Created:
4 years, 1 month ago by jam
Modified:
4 years, 1 month ago
Reviewers:
Devlin
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix content script injection not working with PlzNavigate because of different navigation timings. Without PlzNavigat, when a frame is created it will have a provisional load URL at the start. With PlzNavigate, this will only be set once the load is completed. ProgrammaticScriptInjector was caching the frame's URL too early and was getting an empty URL as a result. Fix this by calculating it later when it's needed, since at that point it's guaranteed that the frame would have loaded. This fixes ExtensionApiTest.Incognito ExtensionApiTest.JavaScriptURLPermissions ExtensionApiTest.JavasScriptEncodedURL with PlzNavigate. BUG=504347 Committed: https://crrev.com/69e711577ac88bc21ee1823c3dffaa9ee9b2593e Cr-Commit-Position: refs/heads/master@{#429174}

Patch Set 1 #

Total comments: 4

Patch Set 2 : review comments #

Total comments: 2

Patch Set 3 : review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -17 lines) Patch
M extensions/renderer/programmatic_script_injector.h View 1 2 chunks +3 lines, -3 lines 0 comments Download
M extensions/renderer/programmatic_script_injector.cc View 1 2 2 chunks +10 lines, -9 lines 0 comments Download
M extensions/renderer/script_injection_manager.cc View 1 chunk +1 line, -2 lines 0 comments Download
M extensions/renderer/script_injector.h View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/user_script_injector.h View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/user_script_injector.cc View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 28 (19 generated)
jam
4 years, 1 month ago (2016-11-01 20:19:28 UTC) #9
Devlin
lgtm https://codereview.chromium.org/2471553003/diff/40001/extensions/renderer/programmatic_script_injector.cc File extensions/renderer/programmatic_script_injector.cc (right): https://codereview.chromium.org/2471553003/diff/40001/extensions/renderer/programmatic_script_injector.cc#newcode72 extensions/renderer/programmatic_script_injector.cc:72: url_ = ScriptContext::GetDataSourceURLForFrame(frame); Do we document anywhere at ...
4 years, 1 month ago (2016-11-01 23:39:32 UTC) #14
jam
https://codereview.chromium.org/2471553003/diff/40001/extensions/renderer/programmatic_script_injector.cc File extensions/renderer/programmatic_script_injector.cc (right): https://codereview.chromium.org/2471553003/diff/40001/extensions/renderer/programmatic_script_injector.cc#newcode72 extensions/renderer/programmatic_script_injector.cc:72: url_ = ScriptContext::GetDataSourceURLForFrame(frame); On 2016/11/01 23:39:32, Devlin wrote: > ...
4 years, 1 month ago (2016-11-01 23:47:03 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2471553003/60001
4 years, 1 month ago (2016-11-01 23:48:08 UTC) #18
Devlin
https://codereview.chromium.org/2471553003/diff/60001/extensions/renderer/programmatic_script_injector.cc File extensions/renderer/programmatic_script_injector.cc (right): https://codereview.chromium.org/2471553003/diff/60001/extensions/renderer/programmatic_script_injector.cc#newcode73 extensions/renderer/programmatic_script_injector.cc:73: // UserScript::DOCUMENT_END. I'm confused - how would we inject ...
4 years, 1 month ago (2016-11-02 00:02:58 UTC) #19
jam
https://codereview.chromium.org/2471553003/diff/60001/extensions/renderer/programmatic_script_injector.cc File extensions/renderer/programmatic_script_injector.cc (right): https://codereview.chromium.org/2471553003/diff/60001/extensions/renderer/programmatic_script_injector.cc#newcode73 extensions/renderer/programmatic_script_injector.cc:73: // UserScript::DOCUMENT_END. On 2016/11/02 00:02:57, Devlin wrote: > I'm ...
4 years, 1 month ago (2016-11-02 00:14:43 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2471553003/80001
4 years, 1 month ago (2016-11-02 00:28:54 UTC) #24
commit-bot: I haz the power
Committed patchset #3 (id:80001)
4 years, 1 month ago (2016-11-02 01:16:08 UTC) #26
commit-bot: I haz the power
4 years, 1 month ago (2016-11-02 01:19:47 UTC) #28
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/69e711577ac88bc21ee1823c3dffaa9ee9b2593e
Cr-Commit-Position: refs/heads/master@{#429174}

Powered by Google App Engine
This is Rietveld 408576698