-
Notifications
You must be signed in to change notification settings - Fork 887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use frame url for scripts without sources #17979
Conversation
8b2b98c
to
df5cb84
Compare
What happens if the script is being executed in an iframe with URL of |
should report |
I dont think thats correct then. I will double check, but (I believe) a script in the example I gave should count as executing in the first non-about:blank parent frame |
yes, I think im correct, you want to base things off of whatever |
df5cb84
to
0a95625
Compare
571403b
to
b8c1163
Compare
// For scripts w/o sources it should report the domain / site used for | ||
// executing the frame (which most, but not all, of the time will just be from | ||
// document.location | ||
if (secondary_url.SchemeIs(url::kDataScheme)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't look complete to me. I think what you want is SchemeIsLocal
, or maybe just always GetSecurityOrigin()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SchemeIsLocal
looks good, thanks, updated
b8c1163
to
f7b95ce
Compare
f7b95ce
to
943c7b3
Compare
Are there tests for the following cases? If so, then I think this is good:
|
yes, they are using a.com with a script without source and with
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm with the additional tests
GURL secondary_url(script_url); | ||
// For scripts w/o sources it should report the domain / site used for | ||
// executing the frame (which most, but not all, of the time will just be from | ||
// document.location |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uber-nit, here: you forgot the closing )
in the source comment, after // document.location)
Verified
|
Brave | 1.52.39 Chromium: 112.0.5615.49 (Official Build) nightly (64-bit) |
---|---|
Revision | bd2a7bcb881c11e8cfe3078709382934e3916914-refs/branch-heads/5615@{#936} |
OS | Windows 10 Version 22H2 (Build 19045.2846) |
Steps:
Followed those from brave/brave-browser#29585 (comment)
Confirmed the scripts which previously showed from null
are now showing from https://apps.facebook.com
example | example | example | example | example |
---|---|---|---|---|
@spylogsster mind getting an uplift going to |
Uplift of #17979 (squashed) to beta
Resolves brave/brave-browser#29585
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run lint
,npm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: