Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Twixes
Copy link

@Twixes Twixes commented Apr 27, 2021

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
Copy link
Author

Twixes commented Jun 16, 2021

Bump?

@feross
Copy link
Owner

feross commented Jun 30, 2021

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
Copy link
Author

Twixes commented Jun 30, 2021

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

@feross
Copy link
Owner

feross commented Jun 30, 2021

@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
Copy link
Author

Twixes commented Jul 1, 2021

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

@Twixes
Copy link
Author

Twixes commented Sep 5, 2021

Bump?

@Twixes
Copy link
Author

Twixes commented Nov 3, 2021

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