Closed Bug 1502665 Opened 7 years ago Closed 7 years ago

window.confirm() and window.prompt() always returns <undefined>

Categories

(Core :: DOM: Core & HTML, defect)

63 Branch
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: vraimentres, Unassigned)

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:63.0) Gecko/20100101 Firefox/63.0 Steps to reproduce: var foo = window.confirm('hello'); console.log(foo); var bar = window.prompt('how are you?'); console.log(bar); Actual results: When I press OK button to 'foo' confirm window: > undefined When I press Cancel button to 'foo' confirm window: > undefined When I enter "I'm fine." to 'bar' prompt window: > undefined When I press Cancel button to 'bar' prompt window: > undefined Expected results: When I press OK button to 'foo' confirm window: > true When I press Cancel button to 'foo' confirm window: > false When I enter "I'm fine." to 'bar' prompt window: > "I'm fine." When I press Cancel button to 'bar' prompt window: > null
Hmm, I get your expected results and the same in Chrome. At first I thought it was to do with the page you were on bug google.co.kr works for me, too. Can you make a standalone testcase?
Flags: needinfo?(vraimentres)
(In reply to Andrew Overholt [:overholt] from comment #1) > Hmm, I get your expected results and the same in Chrome. At first I thought > it was to do with the page you were on bug google.co.kr works for me, too. > > Can you make a standalone testcase? The 63branch for windows works as expected, but the same 63 branch for Mac OS returns those confusing results. I have tested this problem not only from google.com but also from some other websites. and got same "undefined" issue.
Flags: needinfo?(vraimentres)
Hmm, I can't reproduce on a Mac, either. Are you perhaps referring to the "<- undefined" that's echoed after the console.log statements?
Flags: needinfo?(vraimentres)
Flags: needinfo?(vraimentres)
(In reply to Andrew Overholt [:overholt] from comment #3) > Hmm, I can't reproduce on a Mac, either. Are you perhaps referring to the > "<- undefined" that's echoed after the console.log statements? Oh, nope. My codes work fine in other circumstances. But Only recent version of firefox for mac makes trouble... :(
I'm stumped. Maybe one of the excellent devtools team members will know.
Flags: needinfo?(pbrosset)
Attached image confirm.gif
I was unfortunately unable to reproduce this problem locally. I tested on Mac with Firefox 63, 64 and 65. Here's a screen recording of what happens for me when I test locally. Do you think it somehow possible that the confirm and prompt functions are overridden on the pages you tested? Do you see the confirm and prompt dialog shown when executing these functions? Do you see browser errors in the browser console (cmd+shift+J to open this console on mac)?
Flags: needinfo?(pbrosset) → needinfo?(vraimentres)

Not enough information, closing

Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → INCOMPLETE
Flags: needinfo?(vraimentres)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: