Open Bug 1255340 Opened 9 years ago Updated 1 year ago

FF redirects to null.com while dataTransfer.setData("text", null) dragstart event definition

Categories

(Core :: DOM: Copy & Paste and Drag & Drop, defect, P5)

All
Other
defect

Tracking

()

UNCONFIRMED

People

(Reporter: springer.ronny, Unassigned)

References

()

Details

(Keywords: dev-doc-needed, Whiteboard: btpp-followup-2016-04-21)

:: Developer Documentation Request Request Type: New Documentation Gecko Version: unspecified Technical Contact: rolfedh@gmail.com :: Details Hi, I found a unwanted behaviour if second parameter is passed as null or undefined while using .setData(format, data) at 'dragstart' event definition - firefox redirects to null.com or undefined.com after 'dragend' event is passed. event.stopPropagation(); inside 'dragend' handler methode does not prevent redirect. Could someone please update the documentation and mentioned that an empty string is well defined default data string? code snipped: ... dragstart: function (event) { if (browser.isFF) { event.originalEvent.dataTransfer.setData("text", null); } } ... dragend: function (event) { ... event.stopPropagation(); ... } ... This behaviour occurred since FF41 up to FF44.
Ronny, do you know if this behaviour also occurs in other browsers? In other work is this a bug in Firefox (in addition to the docs)
Flags: needinfo?(springer.ronny)
Hi Jean-Yves, a customer reported this issue only with FF41. I checked Chrome49, IE11, IEedge and Safari9 which are working well with .setData("text", null). This ticket is neither critical not urgent because I follow the specification via empty string at '.setData("text", "")'. This little change works fine with all mentioned browsers. I figured out that any string will be converted into a redirect url, e.g. '.setData("text", "firefox")' > firefox.com. Thanks. Spec > https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/setData
Flags: needinfo?(springer.ronny)
I'm moving this bug to the right (IMHO) component for triaging by the dev teams. I'll keep an eye an it to see if there is a need to update our docs. Spec entry: https://html.spec.whatwg.org/#the-datatransfer-interface Our webidl: http://mxr.mozilla.org/mozilla-central/source/dom/webidl/DataTransfer.webidl
Component: General → Untriaged
Keywords: dev-doc-needed
Product: Developer Documentation → Core
Could you please share an opinion on this issue?
Component: Untriaged → DOM
Flags: needinfo?(bugs)
So per HTML and WebIDL specs passing null as the 2nd param here means the value is converted to string "null". Do other browsers not do that? Do they keep the value as null, meaning that getData ends up returning null, and not "null". Or do they convert the value to ""?
Flags: needinfo?(bugs) → needinfo?(springer.ronny)
Whiteboard: btpp-followup-2016-04-21
Component: DOM → DOM: Core & HTML

Can confirm my mobile using Android firefox version 68.6.0 also directs my browser page on start up to null.com on occasions. It is very difficult to get it to reproduce the issue. My firefox is set to startpage.com and this works the vast majority of the time. However once a week I open firefox and I get null.com come up instead. I do use an antivirus/malware scanner on my mobile (which reports as virus free) and also I don't side-load apps from dodgy sources, so everything is from the google app store with its protections enabled.

Just a thought I do wonder if this issue may be due to firefox auto-updating from the google store and then on first boot up of a new build it opens the browser view and goes to null.com because it doesn't get the instruction to go to the correct home page quick enough in that instance?

Component: DOM: Core & HTML → DOM: Copy & Paste and Drag & Drop
Flags: needinfo?(htsai)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.