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

Issue 2196983002: Allow doc.written scripts with a matching domain and registry to execute. (Closed)

Created:
4 years, 4 months ago by Bryan McQuade
Modified:
4 years, 4 months ago
CC:
blink-reviews, chromium-reviews, gavinp+loader_chromium.org, Nate Chapin, loading-reviews_chromium.org, tyoshino+watch_chromium.org, Yoav Weiss
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Allow doc.written scripts with a matching domain and registry to execute. We currently allow scripts to execute as long as they are on the same hostname as the document. This change also allows scripts to execute if they have the same domain+registry as the document. For example, if a script is on static.example.com, and the main document is on www.example.com, the script will be allowed to execute, since the domain+registry for both script and document is example.com. I didn't see a way to write a layout test for this, as layout tests don't allow serving resources from actual domains (only 127.0.0.1 and localhost). BUG=632986 Committed: https://crrev.com/c3892ef2fb30045b8f9173839818914c1162fcc3 Cr-Commit-Position: refs/heads/master@{#409875}

Patch Set 1 #

Patch Set 2 : revert unintended change #

Patch Set 3 : fix comment #

Total comments: 2

Patch Set 4 : add test #

Total comments: 4

Patch Set 5 : address comments #

Patch Set 6 : fix compiler error #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+75 lines, -1 line) Patch
M third_party/WebKit/Source/core/loader/FrameFetchContext.cpp View 1 2 3 4 2 chunks +15 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/network/NetworkUtils.h View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/network/NetworkUtils.cpp View 1 2 3 4 5 2 chunks +27 lines, -0 lines 1 comment Download
M third_party/WebKit/Source/platform/network/NetworkUtilsTest.cpp View 1 2 3 4 1 chunk +26 lines, -0 lines 0 comments Download

Messages

Total messages: 43 (30 generated)
Bryan McQuade
PTAL
4 years, 4 months ago (2016-08-01 09:50:28 UTC) #10
shivanisha
https://codereview.chromium.org/2196983002/diff/40001/third_party/WebKit/Source/platform/network/NetworkUtilsTest.cpp File third_party/WebKit/Source/platform/network/NetworkUtilsTest.cpp (right): https://codereview.chromium.org/2196983002/diff/40001/third_party/WebKit/Source/platform/network/NetworkUtilsTest.cpp#newcode83 third_party/WebKit/Source/platform/network/NetworkUtilsTest.cpp:83: EXPECT_EQ("appspot.com", NetworkUtils::getDomainAndRegistry("www.foo.appspot.com", false)); Can we also include the example ...
4 years, 4 months ago (2016-08-01 16:35:55 UTC) #15
Bryan McQuade
On 2016/08/01 at 16:35:55, shivanisha wrote: > https://codereview.chromium.org/2196983002/diff/40001/third_party/WebKit/Source/platform/network/NetworkUtilsTest.cpp > File third_party/WebKit/Source/platform/network/NetworkUtilsTest.cpp (right): > > https://codereview.chromium.org/2196983002/diff/40001/third_party/WebKit/Source/platform/network/NetworkUtilsTest.cpp#newcode83 ...
4 years, 4 months ago (2016-08-01 18:42:50 UTC) #18
Bryan McQuade
PTAL, thanks! https://codereview.chromium.org/2196983002/diff/40001/third_party/WebKit/Source/platform/network/NetworkUtilsTest.cpp File third_party/WebKit/Source/platform/network/NetworkUtilsTest.cpp (right): https://codereview.chromium.org/2196983002/diff/40001/third_party/WebKit/Source/platform/network/NetworkUtilsTest.cpp#newcode83 third_party/WebKit/Source/platform/network/NetworkUtilsTest.cpp:83: EXPECT_EQ("appspot.com", NetworkUtils::getDomainAndRegistry("www.foo.appspot.com", false)); On 2016/08/01 at 16:35:55, ...
4 years, 4 months ago (2016-08-01 18:43:51 UTC) #19
shivanisha
On 2016/08/01 at 18:43:51, bmcquade wrote: > PTAL, thanks! > > https://codereview.chromium.org/2196983002/diff/40001/third_party/WebKit/Source/platform/network/NetworkUtilsTest.cpp > File third_party/WebKit/Source/platform/network/NetworkUtilsTest.cpp ...
4 years, 4 months ago (2016-08-01 18:52:18 UTC) #20
Bryan McQuade
japhet, PTAL, thanks!
4 years, 4 months ago (2016-08-01 19:02:34 UTC) #22
Nate Chapin
https://codereview.chromium.org/2196983002/diff/60001/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp File third_party/WebKit/Source/core/loader/FrameFetchContext.cpp (right): https://codereview.chromium.org/2196983002/diff/60001/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp#newcode124 third_party/WebKit/Source/core/loader/FrameFetchContext.cpp:124: if (!requestDomain.isEmpty() && !documentDomain.isEmpty() && requestDomain == documentDomain) Nit: ...
4 years, 4 months ago (2016-08-03 21:44:09 UTC) #25
Bryan McQuade
Thanks! Addressed japhet's comments. kinuko, PTAL for blink platform, thanks! https://codereview.chromium.org/2196983002/diff/60001/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp File third_party/WebKit/Source/core/loader/FrameFetchContext.cpp (right): https://codereview.chromium.org/2196983002/diff/60001/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp#newcode124 ...
4 years, 4 months ago (2016-08-03 22:05:46 UTC) #29
kinuko
lgtm for platform/ I guess you could possibly layout-test this, we have some cross-origin tests. ...
4 years, 4 months ago (2016-08-04 18:08:04 UTC) #36
Bryan McQuade
On 2016/08/04 at 18:08:04, kinuko wrote: > lgtm for platform/ > > I guess you ...
4 years, 4 months ago (2016-08-04 19:39:28 UTC) #37
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/2196983002/100001
4 years, 4 months ago (2016-08-04 19:40:19 UTC) #40
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 4 months ago (2016-08-04 19:49:27 UTC) #41
commit-bot: I haz the power
4 years, 4 months ago (2016-08-04 19:51:32 UTC) #43
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/c3892ef2fb30045b8f9173839818914c1162fcc3
Cr-Commit-Position: refs/heads/master@{#409875}

Powered by Google App Engine
This is Rietveld 408576698