Closed
Bug 331956
Opened 20 years ago
Closed 20 years ago
keyword shortcut's %s parameter doesn't work with javascript when using special characters
Categories
(Firefox :: Bookmarks & History, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: pbspam, Unassigned)
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1
When launched from the command line, JavaScript seems to have a problem with strings containing encoded characters, like "%E9%E1%ED%FA%F5%FB".
Reproducible: Always
Steps to Reproduce:
1. create a new bookmark, give it a keyword (i'll use "s"), and type the following in the location bar: javascript:document.write("%s");document.close();. Click OK.
2. type "s יץ" in the location bar. (if the latter two characters do not appear right, you can invoke them with Alt+0225 and Alt+0245, respectively.) Press Enter.
Actual Results:
nothing happens, as though JS froze.
Expected Results:
בץ (or, at least, %E1%3F :-)) printed in the document body.
If I assign the %s to a var first (like str="%s"), and then try to do some replace stuff, it doesn't work either. JS just doesnt seem to like %E1%3F-type strings when invoked from the command line. On the other hand, if I create a HTML file with <script>document.write("%E1%3F");document.close()</script>, it outputs %E1%3F. (at least something, i could process it with my own url decoding function)
Another inconsistency is that if I replace
javascript:document.write("%E1%3F");document.close();
(it appears right after typing "s יץ") with
javascript:document.write("יץ");document.close();
it works fine, and displays the two special characters.
It might seem a minor bug, but it's very irritating because one cannot preprocess search queries containing special characters with the .replace method.
> 1. create a new bookmark, give it a keyword (i'll use "s"), and type the
> following in the location bar:
> javascript:document.write("%s");document.close();. Click OK.
> 2. type "s יץ" in the location bar. (if the latter two characters do not appear
Correction: the first "location bar" refers to the bookmark's Location: field, the second to the browser's main address bar.
Comment 2•20 years ago
|
||
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060327 Firefox/1.6a1
WFM
After following all the directions of the reporter I was no able to reproduce this bug.
(In reply to comment #2)
> Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060327
> Firefox/1.6a1
>
> WFM
>
> After following all the directions of the reporter I was no able to reproduce
> this bug.
I just tried the otherwise exceptionally buggy Firefox/1.6a1, and WFM, too. However, there's still another problem with replace, I posted a new bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=332024 .
Comment 4•20 years ago
|
||
Reporter says WFM.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•