The default bug view has changed. See this FAQ.

Nonexistant about: url should show an error page rather than throwing a dialog

RESOLVED FIXED in mozilla13

Status

()

Core
Document Navigation
RESOLVED FIXED
10 years ago
3 years ago

People

(Reporter: Gábor Stefanik, Assigned: O. Atsushi (Torisugari))

Tracking

(Blocks: 1 bug)

Trunk
mozilla13
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

10 years ago
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.
(Reporter)

Comment 1

10 years ago
->All/All.
OS: Windows Vista → All
Hardware: PC → All

Comment 2

10 years ago
This is actually a docshell bug: http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/docshell/base/nsDocShell.cpp&rev=1.834&mark=2988-2990#2986

ref. bug 291876 and bug 306409.
Component: Networking → Embedding: Docshell
QA Contact: networking → docshell
Duplicate of this bug: 382701
We already have a bug on the "use error page when we can't create URI" problem, no?  This would be a duplicate.
Whiteboard: DUPEME
(Assignee)

Comment 5

5 years ago
(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?
(Assignee)

Comment 6

5 years ago
Created attachment 581971 [details] [diff] [review]
proposal v1

It seems to me the session history works as expected.
(Assignee)

Updated

5 years ago
Blocks: 616843
(Assignee)

Updated

5 years ago
Attachment #581971 - Flags: review?(cbiesinger)
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.
Attachment #581971 - Flags: review?(cbiesinger) → review+
Assignee: nobody → torisugari
(Assignee)

Comment 8

5 years ago
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

5 years ago
If Christian signs off on a particular comment, I'm happy to update the patch and land it.
(Assignee)

Comment 10

5 years ago
(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.

Updated

5 years ago
Depends on: 312680
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
http://hg.mozilla.org/integration/mozilla-inbound/rev/1dcee8f1559a
https://hg.mozilla.org/mozilla-central/rev/1dcee8f1559a
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13

Comment 14

5 years ago
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?

Updated

4 years ago
Depends on: 867957

Updated

3 years ago
Whiteboard: DUPEME
You need to log in before you can comment on or make changes to this bug.