Chrome downloads mhtml files instead of opening them |
|||||
Issue descriptionChrome Version: Canary 66.0.3350.0 OS: Android Enable Page Sharing in flags. 1. Save (download) a page. 2. Find it in Android Downloads, click on it Expected: open page in chrome Observed: preview is not avilable dialog, when select Chrome from "Open With", it downloads it instead of opening.
,
Feb 20 2018
I saved Wikipedia's landing page as an offline page and inspected the intents generated by ADM (from Android O) and ASTRO File Manager, an app that successfully opens the file with Chrome Canary. These are the differences I found: Type: * ADM: multipart/related * ASTRO: message/rfc822 Data: * ADM: content://com.android.providers.downloads.documents/document/3453 * ASTRO: content://com.metago.astro.filecontent/file/storage/emulated/0/Download/Wikipedia, the free encyclopedia.mhtml Flags: * ADM: FLAG_ACTIVITY_FORWARD_RESULT, FLAG_ACTIVITY_PREVIOUS_IS_TOP, FLAG_GRANT_READ_URL_PERMISSION * ASTRO: FLAG_ACTIVITY_FORWARD_RESULT, FLAG_ACTIVITY_PREVIOUS_IS_TOP
,
Feb 20 2018
,
Feb 20 2018
,
Feb 20 2018
This is caused by ContentResolver.getType() returning "application/octet-stream", instead of "multipart/related" in Oreo. It is called at https://cs.chromium.org/chromium/src/base/android/java/src/org/chromium/base/ContentUriUtils.java?type=cs&l=120.
,
Feb 21 2018
,
Mar 16 2018
Android bug was filed: http://b/73736356
,
Mar 21 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/74b656c180ca06d86caef3cb42df977cdafadf76 commit 74b656c180ca06d86caef3cb42df977cdafadf76 Author: Jian Li <jianli@chromium.org> Date: Wed Mar 21 00:25:34 2018 Pass intent type in extra headers for content URI On Oreo, ContentResolver.getType() returns "application/octet-stream" for content uri that is sent from Android Downloads Home, instead of the registered MIME type. To work around this, we pass the intent type in extra headers such that content request job can get it. Bug: 813906 Change-Id: I86c87b0458dc5b4311bcd7ae7248af1ea9df7eaf Reviewed-on: https://chromium-review.googlesource.com/961560 Reviewed-by: Ted Choc <tedchoc@chromium.org> Reviewed-by: Maria Khomenko <mariakhomenko@chromium.org> Reviewed-by: Min Qin <qinmin@chromium.org> Commit-Queue: Jian Li <jianli@chromium.org> Cr-Commit-Position: refs/heads/master@{#544602} [modify] https://crrev.com/74b656c180ca06d86caef3cb42df977cdafadf76/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java [modify] https://crrev.com/74b656c180ca06d86caef3cb42df977cdafadf76/chrome/android/javatests/src/org/chromium/chrome/browser/IntentHandlerTest.java [modify] https://crrev.com/74b656c180ca06d86caef3cb42df977cdafadf76/content/browser/android/url_request_content_job.cc [modify] https://crrev.com/74b656c180ca06d86caef3cb42df977cdafadf76/content/browser/android/url_request_content_job.h [modify] https://crrev.com/74b656c180ca06d86caef3cb42df977cdafadf76/content/browser/android/url_request_content_job_unittest.cc
,
Mar 21 2018
,
Mar 22 2018
Verified on Chrome:67.0.3378.0 Device:Nexus 6/MRA59G with the steps mentioned in C#0 |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by dim...@chromium.org
, Feb 20 2018Components: -UI>Browser>Offline