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)
Core
DOM: Navigation
Tracking
()
NEW
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.
Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
Comment 1•6 years ago
|
||
Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.
Webcompat Priority: --- → ?
Comment 2•6 years ago
|
||
See bug 1547409. Migrating whiteboard priority tags to program flags.
Comment 3•6 years ago
|
||
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)
Updated•6 years ago
|
Webcompat Priority: ? → revisit
Comment 5•5 years ago
|
||
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
Updated•3 years ago
|
Webcompat Priority: revisit → P3
See Also: → https://github.com/whatwg/html/issues/1896
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•