Issue metadata
Sign in to add a comment
|
Drag and drop files from Files app (Google Drive) -> browser does not open the file. |
|||||||||||||||||||||||
Issue descriptionChrome Version: ToT OS: Chrome What steps will reproduce the problem? (1) Open Drive volume in Files app (2) Drag an image file from Files app (3) Drop on a browser window What is the expected result? The browser should open the image What happens instead? The browser shows an empty page.
,
Feb 22 2018
<files-triage>
,
Feb 22 2018
,
Feb 26 2018
An externalfile: URL (e.g. "externalfile:drive-a5e...497/root/​filename.png") is set to DropData.url when a drive file is dragged from Files app. This URL is rejected by ChildProcessSecurityPolicyImpl::CanRequestURL [1] and is replaced by "about:blank" because "externalfile:" is not registered as WebSafeScheme [2]. [1] : Stack trace ChildProcessSecurityPolicyImpl::CanRequestURL RenderProcessHostImpl::FilterURL RenderWidgetHostImpl::FilterDropData WebContentsViewAura::OnDragEntered [2] : List of schemes registered as WebSafeScheme in ChildProcessSecurityPolicyImpl http, https, ftp, data, feed, blob, filesystem
,
Feb 26 2018
I found the following code for whitelisting externalfile:// for ChromeOS in browser_file_system_helper.cc
void PrepareDropDataForChildProcess(...) {
#if defined(OS_CHROMEOS)
// The externalfile:// scheme is used in Chrome OS to open external files in a
// browser tab.
if (drop_data->url.SchemeIs(content::kExternalFileScheme))
security_policy->GrantRequestURL(child_id, drop_data->url);
#endif
I wonder if we should whitelist externalfile:// for ChromeOS in ChildProcessSecurityPolicyImpl as well.
,
Feb 26 2018
FYI, browser URL box accepts this externalfile: URL.
(Copy/paste-ing the externalfile: URL ("externalfile:drive-a5e...497/root/​filename.png") into the browser URL box opens the drive web page.)
,
Feb 26 2018
,
Feb 27 2018
hirono@-san suggested that handling filesystem: URL might be better than handling external: URL.
I confirmed that DropData contains filesystem: URL below along with externalfile: URL when dragging a GDrive file.
DropData
url : externalfile:drive-a5e639...81cd497/root/test1.gdoc
file_system_url : filesystem:chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/external/drive-a5e639...81cd497/root/test1.gdoc
The problem seems to be that DragData::AsURL (function used for obtaining target URL in PerformDrag) never returns filesystem: URL even when DragData contains filesystem: URL.
String DragData::AsURL(FilenameConversionPolicy filename_policy,
String* title) const {
String url;
if (platform_drag_data_->Types().Contains(kMimeTypeTextURIList))
platform_drag_data_->UrlAndTitle(url, title);
else if (filename_policy == kConvertFilenames && ContainsFiles())
url = FilePathToURL(platform_drag_data_->Filenames()[0]);
return url;
}
(Call stack)
DragData::AsURL
DragController::PerformDrag
WebFrameWidgetBase::DragTargetDrop
,
Feb 28 2018
Notes of discussions with hirono@ - Currently Files App sets both externalfile URL and filesystem URL into clipboard, but it should actually set only filesystem URL. (file_transfer_controller.js) - Update browser to converting filesystem URL to externalfile URL in PrepareDropDataForChildProcess - FileSystemURLToExternalFileURL can be used for the conversion, but the function needs to be moved out of src/chrome/browser/chromeos/... to src/content/...
,
Feb 28 2018
,
Feb 28 2018
,
Feb 28 2018
,
Feb 28 2018
,
Feb 28 2018
,
Mar 22 2018
,
Mar 29 2018
Hi hirono-san, is this bug really blocked by 811679 (Migrate callers of ConvertPathToArcUrl) ?
,
Mar 29 2018
,
Apr 11 2018
Just a quick check - Can you confirm if this is a known behavior or regression? Are we still targeting this fix for M67?
,
Apr 11 2018
We are not targeting this fix for M67 any more, as we are working on more urgent P tasks now. Unssigning myself. I think hirono@-san knows whether it's a regression or not.
,
Apr 11 2018
IIRC, this is a regression issue.
,
Apr 12 2018
,
May 17 2018
Hi, I came across this bug while investigating another issue for files from Drive. I tried to reproduce and couldn't reproduce on M66: 66.0.3359.137 Nor on my dev device: 68.0.3410.0 I dragged an image file from Files.app (from within Drive) to browser to create a new tab and it showed the image on the browser correctly. Closing as won't fix. Please re-open if it still occurring.
,
May 17 2018
I could reproduce it with 68.0.3431.0. It looks the video attached #22 is dragging file from Downloads instead of Drive. Also please drop a file on the main content area instead of omnibox to reproduce the issue.
,
May 24 2018
,
Jul 18
,
Jul 18
Could this be related to issue 862282? Joel, do you have time to take a look?
,
Jul 25
,
Aug 8
,
Oct 2
,
Oct 4
,
Nov 2
This is fixed with drivefs. |
||||||||||||||||||||||||
►
Sign in to add a comment |
||||||||||||||||||||||||
Comment 1 by hirono@chromium.org
, Jan 16 2018