[Local NTP] Send Origin to interactive Doodle iframe |
|||||||||
Issue descriptionOn the local NTP, interactive Doodles (i.e. not simple or animated ones) are embedded in an iframe. The server only allows the page to be iframed if it's on "chrome-search://local-ntp", but currently Chrome doesn't send an "Origin:" or "Referer:" header. So the server can't tell that it's the local NTP, sends "X-Frame-Options: SAMEORIGIN", and things break.
,
Feb 6 2018
,
Feb 13 2018
,
Mar 5 2018
This is required for launching interactive Doodles on the local NTP.
,
Jul 27
,
Aug 2
,
Sep 12
,
Sep 17
I don't think this can be solved solely with NTP changes, we'll probably need to do something on the Doodle team's side. To address some of the points in c1: The origin IS sent with cross-origin requests, but the request for the fpdoodle page isn't sent as a cross origin request, it's simply a GET request for the page. It's only identified as cross-origin when the browser attempts to render it in the iframe, at which point X-FRAME-OPTIONS is already SAME-ORIGIN. The proper way to fix this would be to set the iframe's referrerPolicy = "origin", but the referrer is stripped out by Blink due to not being http(s). Some other options: Set frame-ancestors: 'chrome-search"//local-ntp/' in the fpdoodle's CSP. I don't see a CSP for the fpdoodle page currently, I guess it'd be the same as google.com's. Send an XHR GET request for the url, something like: function ddlHandler() { console.log("readyState:", this.readyState); if (this.readyState === this.DONE && this.status == 200) { var data_url = URL.createObjectURL(this.response); $(IDS.LOGO_DOODLE_IFRAME).src = data_url; } }; var xhr = new XMLHttpRequest(); xhr.open('GET', targetDoodle.metadata.fullPageUrl); xhr.onreadystatechange = ddlHandler; xhr.send(); Currently these requests are blocked with the error 'blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource'. Adding the header shouldn't be too difficult but I'm not sure using the data url would preserve the relative links which was the point of iframing to begin with.
,
Sep 18
Maybe we can get Blink to not strip the referrer in this case? It'd require quite a bit of plumbing (some sort of "client" or "delegate" interface, or maybe it can be added to an existing one), but it might be the cleanest solution.
,
Sep 19
Some notes (mainly for myself): need to investigate further but so far it looks the like check here[1] fails, while KURL::StrippedForUseAsReferrer() doesn't affect the chrome-search:// scheme. Though even bypassing both checks fails to send the referrer. [1] https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/weborigin/security_policy.cc?l=110
,
Oct 5
We've added the local ntp to frame-ancestors in fpdoodle's CSP, b/117123566. Once the change is live I'll verify that everything works correctly.
,
Oct 11
,
Oct 16
,
Oct 25
Is this really fixed? Today's video doodle is still blocked in Chrome Canary + Local NTP flag.
,
Oct 25
Thanks for the report! That's a separate issue, the NTP is refusing to iframe google pages with a TLD other than .com . Added crbug.com/898945 to track it. |
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by treib@chromium.org
, Jan 31 2018