Last Comment Bug 382702 - Nonexistant about: url should show an error page rather than throwing a dialog
: Nonexistant about: url should show an error page rather than throwing a dialog
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Document Navigation (show other bugs)
: Trunk
: All All
: -- normal with 1 vote (vote)
: mozilla13
Assigned To: O. Atsushi (Torisugari)
:
Mentors:
about:foo
: 382701 (view as bug list)
Depends on: 312680 867957
Blocks: 616843
  Show dependency treegraph
 
Reported: 2007-05-31 15:50 PDT by Gábor Stefanik
Modified: 2014-01-16 08:29 PST (History)
8 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
proposal v1 (1.61 KB, patch)
2011-12-15 08:03 PST, O. Atsushi (Torisugari)
cbiesinger: review+
Details | Diff | Splinter Review

Description Gábor Stefanik 2007-05-31 15:50:49 PDT
Currently, if the user attempts to go to a nonexistent about: URL (like about:nothing), he/she is greeted with an intrusive error dialog. I suspect that the same happens if a FRAME, OBJECT or IFRAME attempts to load such a page. This is definitely unacceptable. We need error pages, like for the rest of the errors.
Comment 1 Gábor Stefanik 2007-05-31 15:52:40 PDT
->All/All.
Comment 3 Phil Ringnalda (:philor) 2007-05-31 17:37:22 PDT
*** Bug 382701 has been marked as a duplicate of this bug. ***
Comment 4 Boris Zbarsky [:bz] 2007-05-31 23:30:59 PDT
We already have a bug on the "use error page when we can't create URI" problem, no?  This would be a duplicate.
Comment 5 O. Atsushi (Torisugari) 2011-12-14 12:33:48 PST
(In reply to Boris Zbarsky (:bz) from comment #4)
> We already have a bug on the "use error page when we can't create URI"
> problem, no?  This would be a duplicate.

I can't find another "backout of bug 291876" bug.

How about setting "about:blank"? i.e. for an "about:nothing" request,

docshell::currentURI:
  "about:blank"

onLocationChange:
  "about:blank"

Session history:
  "about:blank"

Global history / bookmark:
  kick.

content.location.href:
  "about:blank"

contentDocument.documentURI:
  "about:neterror?e=malformedURI&u=about:nothing&d=Hey,%20watch%20out!"

URLbar:
 "about:blank" or "about:nothing"

The session history will work with this kind of hack?
Comment 6 O. Atsushi (Torisugari) 2011-12-15 08:03:58 PST
Created attachment 581971 [details] [diff] [review]
proposal v1

It seems to me the session history works as expected.
Comment 7 Christian :Biesinger (don't email me, ping me on IRC) 2012-02-10 14:05:43 PST
Comment on attachment 581971 [details] [diff] [review]
proposal v1

Interesting. Yeah, this should work, and it seems reasonable to me. One thing, do add a comment above your NS_NewURI call describing why you're adding this.
Comment 8 O. Atsushi (Torisugari) 2012-02-11 04:08:36 PST
Oh.

I don't have enough time to write a new patch for a month or two.

(In reply to Christian :Biesinger (don't email me, ping me on IRC) from comment #7)
> do add a comment above your NS_NewURI call describing why you're
> adding this.

Then, something like this:
+// Something is wrong with converting from |aURL| to |aURI|. We don't like to let |mFailedURI| NULL (see bug 291876), we provisionally set "about:blank" instead.
Comment 9 Josh Matthews [:jdm] (away until 9/3) 2012-02-11 14:27:53 PST
If Christian signs off on a particular comment, I'm happy to update the patch and land it.
Comment 10 O. Atsushi (Torisugari) 2012-02-11 19:47:13 PST
(In reply to Josh Matthews [:jdm] from comment #9)
> If Christian signs off on a particular comment, I'm happy to update the
> patch and land it.

Thank you very much!

Maybe you've already realized or not, this patch heavily (?) depends on bug 312680's landing. And, btw, I should have put |rv| outside of the {} block and have made it reusable if that is not too confusing to other developers.
Comment 11 Christian :Biesinger (don't email me, ping me on IRC) 2012-02-16 15:31:35 PST
Comment on attachment 581971 [details] [diff] [review]
proposal v1

I'd go for:

// We need a URI object to store a session history entry, so make up a URI
Comment 12 Josh Matthews [:jdm] (away until 9/3) 2012-02-17 20:27:00 PST
http://hg.mozilla.org/integration/mozilla-inbound/rev/1dcee8f1559a
Comment 13 Ed Morley [:emorley] 2012-02-18 09:56:36 PST
https://hg.mozilla.org/mozilla-central/rev/1dcee8f1559a
Comment 14 henryfhchan 2012-02-19 03:30:48 PST
in one of the older bugs, restoring about:blank on session restore caused a large performance hit.  was this fixed, or does the fix for this bug cause this problem again?

Note You need to log in before you can comment on or make changes to this bug.