Issue metadata
Sign in to add a comment
|
[Stable Feedback] Can not save image in Chrome iOS 63 due to blocked script execution |
||||||||||||||||||||
Issue descriptionChrome Version: 63.0.3239.73 OS: iOS What steps will reproduce the problem? Despite crbug.com/777313 , some users still report they can not save image in Chrome iOS 63.0.3239.73. What is the expected result? What happens instead? Please use labels and text to provide additional information. For graphics-related bugs, please copy/paste the contents of the about:gpu page at the end of this report.
,
Dec 13 2017
Just wanted to add here that testers went through the user reports bucket for this and none of the reports for M63 are reproducible.
,
Dec 13 2017
Thank you Lindsay for the update. I agree this is hard to do anything about without more details. The only place I can think of this being an issue is within a cross-origin iframe, which would not be the case if you are directly looking at an image. (Ex: https://domain.com/image.jpg)
,
Dec 14 2017
Here are some feedback reports: When you go to the report, you can click "PII" on the top-right corner of the report to see the URL. Feedback #1: I can reproduce this https://listnr.corp.google.com/report/84766760042 "In all cases it works fine, except when I clicked download button in unsplash.com. This button redirects us to another blank page with original size of image and in that page holding pressed gives us no result. Same link works fine with other browsers (Safari mobile)." Feedback #2: https://listnr.corp.google.com/report/84783923559 Feedback #3: https://listnr.corp.google.com/report/84775126618 Feedback #4: I can not reproduce this and reached out to user for more information https://listnr.corp.google.com/report/84784122103
,
Dec 15 2017
,
Dec 15 2017
Thank you for the details. I started investigating with the first link and found that we fail to inject javascript into the new tab that opens when trying to download an image from unsplash.com. The script injection fails with WKErrorDomain WKErrorJavaScriptExceptionOccurred. I connected Safari Web Inspector and I see the following error in the console: Blocked script execution in 'https://images.unsplash.com/photo-1512927638316-b12f8c1abcc4?ixlib=rb-0.3.5&q=85&fm=jpg&crop=entropy&cs=srgb&dl=joe-green-475962.jpg&s=98076fe927527257b04e9065a9ac892f' because the document's frame is sandboxed and the 'allow-scripts' permission is not set. Also, I'm wondering if this is limited to iOS 11? I CAN actually get the "Save Image" action sheet to display on my iPhone 7 on iOS 10.3.3. Feedback #2 and #3 seem to be trying to access content which may explicitly trying to prevent the user from saving the data.
,
Dec 15 2017
I can confirm that we can't add our scripts to the unsplash.com download page with the error from the inspector in comment #6. I believe this is a new problem in iOS 11. The only difference I can discern from the responses (vs a working raw image), is that in the failure case the content to returned as a "Download" rather than a direct raw image. A header of this form exists in the failure case: Content-Disposition: attachment; filename="filename.jpg" We may need to test a simplified case to ensure this is the root of the problem, but it looks like we can't inject scripts to such downloads anymore. In order to fix this, we probably need to present the image from our own html page (or maybe native download page?). Alternatively, we may be able to directly support the "save" context menu action if we know that the rendered content is a raw file instead of trying to fetch the image url from the DOM. eugenebut@ WDYT?
,
Dec 15 2017
Content-Disposition: attachment; filename="filename.jpg" responses should be handled as Downloads ( crbug.com/574033 ). Do you think this is a dup of crbug.com/574033 ? It's just not clear to me what users mean by "Safe"? "Save the image via context menu" or "Download the image via Download Manager". Mike can you file a separate bug to investigate why the scripts were not injected. Chrome for iOS looses bunch of features without scripts injections.
,
Dec 16 2017
I do believe they mean "via context menu" based on my experience reproducing the issue. I dont think we expect download manager for image because we render the response in the webView if the WKNavigationResponse returns true from canShowMIMEType. https://cs.chromium.org/chromium/src/ios/web/web_state/ui/crw_web_controller.mm?rcl=762d8538528b19ad970a2fc525ca1252c6d1c863&l=4285 I will file a separate bug regarding js injection failure.
,
Jan 10 2018
Does this still need to be labeled "Needs-feedback"?
,
Jan 10 2018
The bug does not have steps to reproduce, so Needs-feedback seems like appropriate label to me.
,
Mar 14 2018
It depends on how the image is opened in the new tab. I believe a user (Alessio) has isolated the use case here: https://productforums.google.com/forum/#!topic/chrome/9WhtBd0t0n8 https://productforums.google.com/d/msg/chrome/9WhtBd0t0n8/pLRNdqysBAAJ See his 3/14 1:56a (PST) comment: target _blank has no context menu. More later..
,
Mar 16 2018
iOS user Alessio reports 3/14 in https://productforums.google.com/d/msg/chrome/9WhtBd0t0n8/4kUodoraBAAJ for Chrome 65, iOS 11.2.6 for both his iPhone and iOS tablet: A link to test this bug is: https://wallpapersite.com/movies/black-panther-hd-5k-12019.html , Just tap on one of the links that show the desired resolution to open the image. and.. the bug occurs only in case [when] the site opens the image with a target "_blank" because if I try to take the image in a new tab by myself the image can be saved without problems but if the site open the image for me in a new tab in this case the image is impossible to save [no long press context menu].
,
Mar 16 2018
For the test page: https://wallpapersite.com/movies/black-panther-hd-5k-12019.html the target="_blank" can be seen be inspecting the anchor elements for the image links, see attached screenshot. The user (Alessio) reports only image link with the target="_blank" parm fail to have the long-press context menu. The DevTools screenshot is from a Windows Desktop. We're assuming iOS would show the same HTML. Although in Italy (+9H WRT PST), Alessio has been responsive and understands the console. If someone can pick this up soon, he may be available to troubleshoot. See the help forum link above.
,
Mar 19 2018
iOS 11.2.6 and Chrome 65 have the same bug as Chrome 63 for iOS Yes, confirm that every site that refers to an image through target "_blank" in a new tab does not allow the saving of the image. a new example can be seen on the hdqwall site (as in attached image).
,
Mar 19 2018
The link for Alex's c#17 example is https://hdqwalls.com/avengers-infinity-war-official-poster-2018-wallpaper
,
Mar 26 2018
I am unable to reproduce on 65.0.3325.152 (current stable release from App Store) and iOS 11.2.6. Please see attached screenshot. I tested by clicking the Original Resolution link from the URL in comment #17. Then long pressed on the image in the new tab. (Am I missing a step to be able to reproduce?)
,
Mar 26 2018
michaeldo@ - Try also the link in c#14. For the c#14 black panther download, he selected one of the target device resolutions. In the past Alex has responded around 9p PST. I'll copy your comment to the forum thread https://productforums.google.com/forum/#!topic/chrome/9WhtBd0t0n8
,
Mar 29 2018
I verified that I can reproduce the issue in c#14 and it is the same problem as I described in comments #6 and #7. Javascript execution is blocked on the page according to an error printed to the web console. We rely on WKWebView to render the image which is causing the injected JavaScript to not be callable from the native application side. I will check if I filed a Radar for this case and file one if I haven't already.
,
Mar 29 2018
I've filed a radar for this issue: https://bugreport.apple.com/web/?problemID=39012096
,
Mar 29 2018
Does this problem inly apply to JPEG images? If I remember correctly for some images we could execute JavaScript.
,
Mar 30 2018
This doesn't apply to all JPEG images, only if the image was meant to be a "download" and includes a header like this:
Content-Disposition: attachment; filename="filename.jpg
If you use the Context Menu to "Open Image", the context menu will work in those cases.
,
Mar 30 2018
I've tried to use Download Manager for responses which use Content-Disposition: attachment and I'm not sure if I liked the user experience. Mike, do you think we could update OpenInController to support images as well?
,
Apr 5 2018
I agree that Download Manager probably isn't the best option. I like the OpenInController solution, it would certainly be an improvement over the current behavior where the image can only be viewed. I was able to very quickly try this and it works to show the image and Open In menu. I did notice that there is no Copy option, but I can debug that further if we decide to go this route. mardini@, Context Menu doesn't display in these cases. WDYT about using OpenInController (see example attached) to help users be able to do something if the website sends the image as a "download"? Note that the screenshots are from simulator, so there are not many options, but more exist on the device.
,
Apr 15 2018
SGTM. Thanks.
,
Jul 30
,
Aug 3
I looked into this and uploaded a CL (crrev.com/c/1162690) for adding support to OpenInController for images. However, I came across these two bugs below which I believe should be fixed before expanding the use of OpenInController to images. crbug.com/862596 The loading UI for "Open In" is currently not being displayed. (Without this fix, there is no UI after the user taps on Open In to indicate that the content is being downloaded.) crbug.com/625616 Open In toolbar is not displayed on images with my prototype CL. I don't know if this bug is the only root cause or if there is more work that needs to be done in order for the bar to display properly.
,
Aug 19
Thanks, Michael. I agree that issue 862596 needs to be fixed. Is there someone working on it? As for issue 625616, does that happen only if the new tab is opened from the Today View?
,
Aug 20
Mardini, no one is actively working on crbug.com/862596 , which blocks this bug.
,
Aug 21
Regarding issue 625616, no it is not just related to Today View. The bar is not displaying on top of any image. It is likely due to the way the bar is being presented, but it could be some other cause.
,
Aug 21
Thanks. Who is the best person to own this and get it across the finish line?
,
Aug 21
Peter or Eric should be able to answer question #33.
,
Aug 22
OK. Let's ping this bug again on Monday when Eric is back
,
Aug 27
The NextAction date has arrived: 2018-08-27
,
Sep 4
Peter, Eric, do we have anyone to add Open In... support for images?
,
Sep 5
I'm confused by this bug. The server returns a clear message that the content should be downloaded, not displayed. Isn't what the download manager is for? Why not sending it directly there, without displaying it first?
,
Sep 5
Re to Comment 38: It is possible to honor "Content-Disposition: attachment" header and we even considered this option ( crbug.com/574033 , https://crrev.com/c/988262). However the user experience of downloading the image is pretty bad. First of all, the user has to tap "Download" and then "Open In...". After that the user has to pick a sharing extension and then open an image in a different app. It's just too much friction for the user and I think we should only use Download Manager for files which can not be displayed in web contents area. FWIW, Chrome for Android does not honor "Content-Disposition: attachment" header. |
|||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||
Comment 1 by sczs@chromium.org
, Dec 13 2017Labels: Needs-Feedback
Owner: hongchic...@chromium.org
Status: Assigned (was: Untriaged)