Open Bug 1499986 Opened 7 years ago Updated 3 years ago

Handling javascript URL returning a non-string value

Categories

(Core :: DOM: Navigation, defect, P3)

defect

Tracking

()

Webcompat Priority P3

People

(Reporter: karlcow, Unassigned)

References

()

Details

(Whiteboard: [webcompat])

This is the minimal test created by Xidorn in https://webcompat.com/issues/14879 <!DOCTYPE html> <meta charset="utf-8"> <script> function test() { a.style.background = "green"; return a; } </script> <a href="javascript:test();">Click this</a> <div id="a" style="width:100px;height:100px;"></div> with this comment. > If we return a string in the function test, both Chrome and Firefox change the page to show the returned string. However, when the returned value is an object, Chrome silently drops the result, while Firefox serializes the result and shows it.
Component: DOM → DOM: Core & HTML

Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.

Webcompat Priority: --- → ?

See bug 1547409. Migrating whiteboard priority tags to program flags.

A test case here: https://miketaylr.com/bzla/return-type-navigation.html

Anne, what is the right thing to do here?

(Note: the reported issue appears to be fixed)

Webcompat Priority: ? → revisit

I think Mike meant to NI Anne here.

Flags: needinfo?(annevk)

This is https://github.com/whatwg/html/issues/1896. It seems that at some point we made a change for how we handle promises (see bug 1382035), but didn't address other returned values, such as the case reported in this bug. Aligning with Chrome and Safari on other non-string values seems like a good initial step, but it seems more work might be needed around other navigation details, such as the load event.

Type: enhancement → defect
Component: DOM: Core & HTML → DOM: Navigation
Flags: needinfo?(annevk)
OS: macOS → Unspecified
Summary: Handling return value for a script → Handling javascript URL returning a non-string value
Version: 57 Branch → Trunk
Webcompat Priority: revisit → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.