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

“Dragging Nodes” section of “Recommended Drag Types” article should not be Firefox-specific #22929

Closed
xBZZZZ opened this issue Dec 13, 2022 · 3 comments
Labels
closed: duplicate This issue or pull request already exists Content:WebAPI Web API docs

Comments

@xBZZZZ
Copy link
Contributor

xBZZZZ commented Dec 13, 2022

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types

What specific section or headline is this issue about?

Dragging Nodes

What information was incorrect, unhelpful, or incomplete?

Nodes and elements in a document may be dragged using the application/x-moz-node type.
I test with this script:
var dt=new DataTransfer()
dt.setData('application/x-moz-node',document.documentElement)
dt.getData('application/x-moz-node')//this line will be the output

results:

where?output
chromium 108.0.5359.95
normal web page
'[object HTMLHtmlElement]'
librewolf 107.0.1-2 (firefox fork)
normal web page
error:
DOMException: The operation is insecure.
librewolf 107.0.1-2 (firefox fork)
about:addons
"[object HTMLHtmlElement]"
There was error or node got stringified.

What did you expect to see?

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@github-actions github-actions bot added needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. Content:WebAPI Web API docs labels Dec 13, 2022
@sideshowbarker sideshowbarker removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Dec 16, 2022
@sideshowbarker
Copy link
Collaborator

It’s unclear what problem you’re pointing out here, or what change you’re suggesting.

Can you please clarify?

@sideshowbarker sideshowbarker added the needs info Needs more information to review or act on. label Dec 16, 2022
@xBZZZZ
Copy link
Contributor Author

xBZZZZ commented Dec 16, 2022

It’s unclear what problem you’re pointing out here, or what change you’re suggesting.

Can you please clarify?

  • firefox specific (because moz)
  • setting application/x-moz-node doesn't work in firefox:
    • dt.setData('application/x-moz-node','put anything here') throws DOMException: The operation is insecure. in firefox
  • and application/x-moz-node doesn't exist by default:
    • dt.getData('application/x-moz-node') always returns empty string
    • (yes, I tried with draggable html element in drop event)

mdn page:

Nodes and elements in a document may be dragged using the application/x-moz-node type. The data for the type should be a DOM node. This allows the drop target to receive the actual node where the drag was started from. Note that callers from a different domain will not be able to access the node even when it has been dropped.

@sideshowbarker sideshowbarker added help wanted If you know something about this topic, we would love your help! and removed needs info Needs more information to review or act on. labels Dec 18, 2022
@sideshowbarker sideshowbarker changed the title Dragging Nodes part is wrong or only worked in very old browser “Dragging Nodes” section of “Recommended Drag Types” article should not be Firefox-specific Dec 18, 2022
@Josh-Cena
Copy link
Member

Let's call it a duplicate of #8404

@Josh-Cena Josh-Cena added closed: duplicate This issue or pull request already exists and removed help wanted If you know something about this topic, we would love your help! labels Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: duplicate This issue or pull request already exists Content:WebAPI Web API docs
Projects
None yet
Development

No branches or pull requests

3 participants