Closed
Bug 27039
Opened 25 years ago
Closed 25 years ago
Can't maintain a bookmark containing a JavaScript URL
Categories
(SeaMonkey :: Bookmarks & History, defect, P3)
Tracking
(Not tracked)
VERIFIED
FIXED
M14
People
(Reporter: sfraser_bugs, Assigned: rhp)
References
Details
(Whiteboard: waiting on fix for bug 27430 to verify)
Attachments
(1 file)
I have a personal toolbar bookmark item containing the following URL:
javascript:if(sint0002 = prompt('Bug Number:','')) location.href="http://
bugzilla.mozilla.org/show_bug.cgi?id=" + sint0002;
I can enter this in the bookmarks properties dialog, and it works the first time
I try it in the browser. However, after quit and restart, the url has been
truncated to
javascript:if(sint0002 = prompt('Bug Number:','')) location.href=
and ceases to work.
Reporter | ||
Comment 1•25 years ago
|
||
The problem here appears to be that URLs containing quotes " are mangled.
Probably some JS quoting issues.
Comment 2•25 years ago
|
||
Comment 3•25 years ago
|
||
Simon, I've attached a diff of a proposed fix which will handle URLs with quotes
correctly. Care to try it out?
That's only part of the fix. In general, I think that nsEscapeHTML() in mozilla/
xpcom/io/nsEscape.cpp needs to escape quotes as well as what it does now for <,
> and &, otherwise bookmark descriptions will have the sample problem.
rhp, you look like the owner of that function. Opinion(s) ???
Status: NEW → ASSIGNED
Comment 4•25 years ago
|
||
Hmmm... might want to delete the last line of the patch:
strm << escapedID;
as its written out twice. Oops... too much copy/paste'ing.
Updated•25 years ago
|
Target Milestone: M14
Comment 5•25 years ago
|
||
Re-assigning to rhp@netscape.com to make nsEscapeHTML() also escape quotes.
Assignee: rjc → rhp
Status: ASSIGNED → NEW
Comment 6•25 years ago
|
||
Note: I checked in my changes to bookmarks so that JavaScript URLs with quotes
should now work.
Assignee | ||
Comment 7•25 years ago
|
||
Uh...I just brought that over from the 4.x world because I needed it throughout
the mail/news back end. I'll look at the code and see what I can do...sounds
pretty simple.
- rhp
Status: NEW → ASSIGNED
Assignee | ||
Comment 8•25 years ago
|
||
Ok, I think I have a pretty simple fix and I've been testing it with mail
display and everything looks fine.
I'll check it in when the tree opens.
- rhp
Assignee | ||
Comment 9•25 years ago
|
||
Fixed nsEscapeHTML() to escape quotes as well.
- rhp
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Comment 10•25 years ago
|
||
sfraser reports that you can hand edit your bookmarks file and have the javascript: url work properly. I'm going to wait on
verification however until the bookmarks properties dialog is back up to speed (bug 27430) to check this out fully
Depends on: 27430
Whiteboard: waiting on fix for bug 27430 to verify
Comment 11•25 years ago
|
||
VERIFIED fixed with the 2000022808 build on MacOS 8.6
Status: RESOLVED → VERIFIED
Updated•20 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•