Closed Bug 690997 Opened 13 years ago Closed 13 years ago

javascript:prompt() doesn't work in bookmarklets

Categories

(Firefox :: General, defect)

9 Branch
x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 692412

People

(Reporter: a.nielsen, Unassigned)

References

Details

User Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:9.0a2) Gecko/20110930 Firefox/9.0a2
Build ID: 20110930042012

Steps to reproduce:

Clicked on the following bookmarklet:

javascript:Qr=document.getSelection();if(!Qr){void(Qr=prompt('Keywords...',''))};if(Qr)location.href='http://en.wikipedia.org/w/wiki.phtml?search='+escape(Qr)


Actual results:

Went to http://en.wikipedia.org/w/wiki.phtml?search=


Expected results:

A popup box appears asking me what page to go to.

Tested with Aurora 8.0a2, updated to 9.0a2 with no change.
does it work with
 Qr=document.getSelection().toString();
?
Yes that does work - looks like the JS code in the bookmarklet is too old...
document.getSelection() returns "object" since Firefox 8, no longer "string". See bug 636512.
Blocks: 636512
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
BTW,  
  Qr=getSelection().toString();
would do the same.
You need to log in before you can comment on or make changes to this bug.