Open Bug 1716229 Opened 3 years ago Updated 10 months ago

Firefox doesn't let you paste text with newlines into prompt() response

Categories

(Toolkit :: Content Prompts, defect)

Firefox 89
defect

Tracking

()

Tracking Status
firefox89 --- affected
firefox90 --- affected
firefox91 --- affected

People

(Reporter: wyattscarpenter, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0

Steps to reproduce:

Try pasting
this text into
console.log(prompt())

Using latest Chrome [Version 91.0.4472.101 (Official Build) (64-bit)] and latest Firefox [89.0 (64-bit)] on the latest version of Windows 10, I tried pasting multi-line text into a prompt and logging the returned string to console. Chrome printed a multi-line string and Firefox a single line string.

Actual results:

Chrome preserves newline characters supplied by the user to prompt(), but Firefox doesn't.

Expected results:

Judging by the HTML living standard https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-prompt , which makes no reference to disallowing newline characters in the user's response, this is probably a bug in Firefox.

Thank you for the report!
I can reproduce this on all the latest Firefox versions on MacOS. Moving this over to it's component so the developers can also check it out.

Severity: -- → S4
Status: UNCONFIRMED → NEW
Component: Untriaged → Notifications and Alerts
Ever confirmed: true
Product: Firefox → Toolkit
Component: Notifications and Alerts → Content Prompts
You need to log in before you can comment on or make changes to this bug.