Skip to content

Support text/uri-list MIME type for onDropText - #58

Open
Twixes wants to merge 1 commit into
feross:masterfrom
Twixes:text-uri-on-drop-text-support
Open

Support text/uri-list MIME type for onDropText#58
Twixes wants to merge 1 commit into
feross:masterfrom
Twixes:text-uri-on-drop-text-support

Conversation

@Twixes

@Twixes Twixes commented Apr 27, 2021

Copy link
Copy Markdown

This allows for drag-and-dropping links contained in HTML anchor elements, if there's no text data available.

Rationale: if using drag-drop in a place where URLs are expected, it's very convenient for dropping links to work not only with outright strings, but also with anchor tags which are common on websites – something like: <a href="https://example.com"><img src="bar"></a>. In this case .getData('text') is empty BUT .getData('text/uri-list') does have useful data – 'https://example.com' – and we should make use of this data.

Before, the user could only right-click, click "Copy link address", and somehow use that copied text in the target app. With this tiny change to drag-drop, the user can simply drag the anchor element to the target app – and that's it. Significant improvement to the user experience.

Please do release new version if this is merged.

@Twixes

Twixes commented Jun 16, 2021

Copy link
Copy Markdown
Author

Bump?

@feross

feross commented Jun 30, 2021

Copy link
Copy Markdown
Owner

What browser are you using? I just tested the version on master and it seems to handle dropped anchor links just fine without the changes in this PR.

@Twixes

Twixes commented Jun 30, 2021

Copy link
Copy Markdown
Author

Electron, specifically https://github.com/webtorrent/webtorrent-desktop

@feross

feross commented Jun 30, 2021

Copy link
Copy Markdown
Owner

@Twixes Can you confirm that this issue still exists on the latest version of electron, which I believe we're using on webtorrent-desktop on the master branch?

Let me know if latest Electron still has this issue.

@Twixes

Twixes commented Jul 1, 2021

Copy link
Copy Markdown
Author

I just tried on webtorrent-desktop master and unfortunately still requires this PR to recognize <a href> elements that don't contain text.

@Twixes

Twixes commented Sep 5, 2021

Copy link
Copy Markdown
Author

Bump?

@Twixes

Twixes commented Nov 3, 2021

Copy link
Copy Markdown
Author

I'm sorry but this still doesn't quite work in the WebTorrent app! Perhaps we could get a solution in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants