New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 799533 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Drag/drop URLs not always working

Reported by caseyhe...@gmail.com, Jan 5 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36

Steps to reproduce the problem:
1. Select some text containing a URL (such as one sent via a chat client)
2. Drag the text clipping to any part of Chrome that typically accepts dropped URLs
3. Be sad

What is the expected behavior?
Chrome should accept the dropped URL text and open it.

What went wrong?
Chrome did not accept the dropped URL text and therefore did not open it.

Did this work before? Yes Unsure

Chrome version: 63.0.3239.132  Channel: stable
OS Version: OS X 10.13.2
Flash Version: 

It appears that when a URL is dropped in as a "bookmark", such as when you drag from the address bar in Safari to Chrome, things work correctly. The problem seems to primarily be when the URL is plain text (such as when sent in a chat client or when typed in a text editor).
 
Cc: sc00335...@techmahindra.com
Labels: Needs-Triage-M63 Triaged-ET Needs-Feedback
caseyheney@ Thanks for the issue.

Tested this issue on Windows 10, Mac OS 10.12.6 on the latest Stable 63.0.3239.132 and Canary 65.0.3314.0 and unable to reproduce the issue by following the steps mentioned in original comment.

On selecting a URL from a chat and dragging and dropping it in the omnibox, able to load the URL without any issues.
Attached is the screen cast for reference.
Request you to please check and confirm if anything is missed from our end in reproducing the issue.

Request you to please retry the issue on a new chrome profile without any flags/extensions and update the thread with the observations.

Thanks.. 
799533.webm
3.6 MB View Download
Your movie definitely shows the feature working as intended. I'm attaching a clip of it working incorrectly.

Also, I'm not sure if it makes a difference, but I'm running the latest version of Mac OS (10.13.2). I noticed that you're testing it on the previous version (10.12).
chrome.mp4
8.7 MB View Download
Screen Shot 2018-01-08 at 9.14.52 AM.png
114 KB View Download
Project Member

Comment 3 by sheriffbot@chromium.org, Jan 8 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "sc00335628@techmahindra.com" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 4 by sdy@chromium.org, Jan 9 2018

Status: Available (was: Unconfirmed)
[Mac triage] It looks like this is a bug in WebView (which Adium uses) which is fixed in WKWebView.

If I create a Swift playground with this code:

    import Cocoa
    import PlaygroundSupport
    import WebKit

    let webView = WebView(frame: NSRect(x: 0, y: 0, width: 200, height: 100))
    webView.mainFrame.loadHTMLString("<a href=\"http://apple.com\">apple.com</a>", baseURL: nil)

    PlaygroundPage.current.liveView = webView

…then dragging the link behaves the same was as Adium. If I replace the two lines in the middle with this:

    let webView = WKWebView(frame: NSRect(x: 0, y: 0, width: 200, height: 100))
    webView.loadHTMLString("<a href=\"http://apple.com\">apple.com</a>", baseURL: nil)

…then the drag works.

I used Clipboard Viewer (which comes with Additional Tools for Xcode) to see the content of the drag pasteboard after each attempt. The difference is that both web views include WebURLsWithTitlesPboardType in the drag, but the one from WebView is empty. When a drag contains WebURLsWithTitlesPboardType, Chrome goes with it and doesn't fall back to the other types on the pasteboard:

https://chromium.googlesource.com/chromium/src/+/13b9ac02d3537053c889ceea6a38d622ecca96b0/third_party/mozilla/NSPasteboard%2BUtils.mm#182

So, this is a macOS/WebView bug, but it probably won't be fixed since its use WKWebView is preferred going forward. Chrome can work around the bug by trying other types on the pasteboard if it doesn't get any URLs from this one.
If it helps justify adding a workaround to Chrome, I've noticed the issue with many different applications, not just Adium. So I don't think it would be a huge leap to see this as a bug with an even larger footprint that affects a larger number of users.

Comment 6 by sdy@chromium.org, Jan 16 2018

Owner: sdy@chromium.org
Status: Assigned (was: Available)

Comment 7 by sdy@chromium.org, Jan 29 2018

Labels: Hotlist-PlatformExcellence
Project Member

Comment 8 by bugdroid1@chromium.org, Feb 1 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/40d081b178a645b1221526d6bc2968975addc8c1

commit 40d081b178a645b1221526d6bc2968975addc8c1
Author: Sidney San Martín <sdy@chromium.org>
Date: Thu Feb 01 01:21:28 2018

When extracting URLs from a pasteboard, keep going if WebURLsWithTitlesPboardType doesn't yield anything.

This fixes an issue where drags from a legacy macOS WebView fail because
they populate WebURLsWithTitlesPboardType in the pasteboard without any
content. (It also looks like there was a crash here if the pasteboard
contained an empty list of URLs.)

Bug:  799533 
Change-Id: I034bcc5bb9cedb86b5cca95601e7bd560eb45965
Reviewed-on: https://chromium-review.googlesource.com/895924
Commit-Queue: Sidney San Martín <sdy@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533510}
[modify] https://crrev.com/40d081b178a645b1221526d6bc2968975addc8c1/third_party/mozilla/NSPasteboard+Utils.mm
[modify] https://crrev.com/40d081b178a645b1221526d6bc2968975addc8c1/third_party/mozilla/README.chromium

Labels: Needs-Feedback
Tried testing the issue again on Mac OS 10.13.3 on the reported version 63.0.3239.132 and unable to reproduce the issue.

No issues are seen on dragging and dropping a URL from a Hangout chat box.

As we are not able to reproduce this issue on the reported version as per comment #2, it is not possible to verify the fix on 66.0.3337.0.
Hence requesting caseyheney@ to please check this issue on the latest Canary 66.0.3337.0 and help us in verifying if the fix is working as intended or not?

Link for downloading latest Canary - https://www.chromium.org/getting-involved/dev-channel.

Thanks..
// Correction in Comment #9.

As Canary 66.0.3337.0 is not available today, request you to please verify this issue on the next available Canary.

The Fix is not yet landed on today's Canary 66.0.3336.5 as well.


Comment 11 by sdy@chromium.org, Feb 5 2018

Status: Fixed (was: Assigned)
It's on Canary now and works for me. Could you see if it's fixed for you when you have a chance?
It looks like the issue has been half fixed. Drag and drop works in the tab area and the address bar now, but not in the window body or dock icon.
testing.mov
15.8 MB Download

Comment 13 by sdy@chromium.org, Feb 5 2018

I think this is a separate issue — in the new video, you drag the text "apple.com" (which isn't a link) from BBEdit into Chrome. Safari, for comparison, accepts this drag and does a web search for "apple.com". Maybe Chrome should do this too, but it'd be more of a feature request.

Could you try it with Adium again? The original problem seems to be specific to content in a WebView, like Adium chats.
Ah yes, dragging links from Adium works "correctly" in all accounts. Looks good to me.

Comment 15 by sdy@chromium.org, Feb 5 2018

Status: Verified (was: Fixed)
Cool, thanks for checking.

Sign in to add a comment