Closed Bug 463176 Opened 16 years ago Closed 16 years ago

NS_ERROR_FACTORY_NOT_REGISTERED from nsIDocShellHistory.useGlobalHistory opening view source

Categories

(Toolkit :: View Source, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.1b3

People

(Reporter: philor, Assigned: cbartley)

References

Details

(Keywords: fixed1.9.1)

Attachments

(2 files)

Bug 17612 added some front-end support for browsing within view-source (which itself is going to be... interesting in a client that doesn't expose http:), and includes back and forward by adding things to session history.

We, of course, don't have global history, so the part where the |disablehistory="true"| was removed from the view-source browser means we now squawk in the error console when the browser constructor tries to wire up global history.
I believe that we can restore the "disablehistory=true", and create our session history programmatically in JavaScript.  This would permit us to use history when available and punt when it's not.  I'm not suggesting that's the best way to approach this problem, but it's one alternative.
Might be what it takes, since disablehistory is just the tip - Tb has a viewSourceOverlay already, so I overlaid disablehistory back in, but then I hit the next failure from nsIWebNavigation.canGoBack...
It might be better just to maintain history manually inside viewSource and not rely on the nsDocShell code at all for this.  ViewSource clearly needs some basic functionality, but other stuff, e.g. visited links, etc. may not be that important.
(In reply to comment #0)
> We, of course, don't have global history, so the part where the
> |disablehistory="true"| was removed from the view-source browser means we now
> squawk in the error console when the browser constructor tries to wire up
> global history.

I guess you don't have session history either? view-source doesn't really care about global history, it just relies on session history. We could have the browser fail gracefully initing global history if that's really the only problem, or allow disabling it specifically.

I don't think it's a good idea to re-implement docshell code in view-source. We should instead make the view-source code handle missing session history without reporting exceptions.
I would have thought we had session history - isn't it implemented in docshell?
Yeah, I guess so. Perhaps we should just have browser.xml catch NS_ERROR_FACTORY_NOT_REGISTERED specifically and ignore it?
I also get this error if I click on a link from a warning/error in the error console (I also get another error, but this is bug 459790). E.g. open the addressbook to trigger the "timed textboxes" warning in the error console and click on that link.

Error: [Exception... "Component returned failure code: 0x80040154 (NS_ERROR_FACTORY_NOT_REGISTERED) [nsIDocShellHistory.useGlobalHistory]"  nsresult: "0x80040154 (NS_ERROR_FACTORY_NOT_REGISTERED)"  location: "JS frame :: chrome://global/content/bindings/browser.xml ::  :: line 643"  data: no]
Source File: chrome://global/content/bindings/browser.xml
Line: 647

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b2pre) Gecko/20081112 Shredder/3.0b1pre
The real problem here appears to be that we can't use the session history for navigation without also touching global history, which Thunderbird doesn't have.  This patch doesn't fix that problem, but it does completely turn off the BACK/FORWARD UI and logic when the view-source browser has disablehistory="true", which seems like a good idea anyway.  This will prevent the exception and error message originally reported in this bug.
Attachment #348078 - Flags: review?(gavin.sharp)
Attachment #348078 - Flags: review?(gavin.sharp) → review+
Comment on attachment 348078 [details] [diff] [review]
Disable all BACK/FORWARD UI and logic when disablehistory="true"
[Checkin: Comment 20 & 23]

This will break if someone dynamically removes the disablehistory attribute after onload, but that's not a case we need to worry about. r=me
Comment on attachment 348078 [details] [diff] [review]
Disable all BACK/FORWARD UI and logic when disablehistory="true"
[Checkin: Comment 20 & 23]

Requesting approval for post-beta 2.  This bug is causing Thunderbird some inconvenience.  With the patch, they will be able to turn off history in view-source, eliminating the annoying exception and error message.  It should be a low risk change for Firefox since these changes won't have any effect with history enabled.
Attachment #348078 - Flags: approval1.9.1?
Still seeing this error report with Shredder build:
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1b2pre) Gecko/20081116 Shredder/3.0b1pre

Are there any projections for when this will drop off the Error Console RADAR?
(In reply to comment #11)
> Still seeing this error report with Shredder build:
> Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1b2pre) Gecko/20081116
> Shredder/3.0b1pre
> 
> Are there any projections for when this will drop off the Error Console RADAR?

You will need to add <<<disablehistory="true">>> to the browser element at the bottom of mozilla/toolkit/components/viewsource/content/viewSource.xul.  That's not part of the patch since we don't won't to disable it for Firefox.  (According to Philor's comment #2, there's a Thunderbird-specific overlay for viewSource.xul that would probably be the best place to put this tag)

Also note that the exception:
Error: uncaught exception: [Exception... "Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsISupports.QueryInterface]"  nsresult: "0x80004002 (NS_NOINTERFACE)"  location: "native frame :: <unknown filename> :: <TOP_LEVEL> :: line 0"  data: no]

is not related.  See bug 459790.
(In reply to comment #12)
> You will need to add <<<disablehistory="true">>> to the browser element at the
> bottom of mozilla/toolkit/components/viewsource/content/viewSource.xul.  That's
> not part of the patch since we don't won't to disable it for Firefox.

Is this the reason why I still get the error on my patched (this patch) Thunderbird build?
Not that I could ever imagine a situation where approval requests off the beaten path would be ignored, but let's move this over to view source, where the bulk of it will be.
Assignee: nobody → cbartley
Component: General → View Source
Product: Thunderbird → Toolkit
QA Contact: general → view.source
Seems to quiet things down nicely, without breaking much of anything.
Attachment #349127 - Flags: review?(mkmelin+mozilla)
Attachment #349127 - Flags: review?(mkmelin+mozilla) → review+
I apply this patches for one week on my own builds now. And since that I doesn't get any error (in the TB error console) anymore.  :)
(In reply to comment #15)
> Created an attachment (id=349127) [details]
> Make disablehistory="true" in Thunderbird view-source
> 
> Seems to quiet things down nicely, without breaking much of anything.

Has this patch landed for Shredder? I still see the Error with the 20081126 Windows build.
Comment on attachment 348078 [details] [diff] [review]
Disable all BACK/FORWARD UI and logic when disablehistory="true"
[Checkin: Comment 20 & 23]

a191=beltzner
Attachment #348078 - Flags: approval1.9.1? → approval1.9.1+
I don't have check-in privileges yet.  Can someone check this patch in for me?
Comment on attachment 348078 [details] [diff] [review]
Disable all BACK/FORWARD UI and logic when disablehistory="true"
[Checkin: Comment 20 & 23]

http://hg.mozilla.org/mozilla-central/rev/7650cecd9913
Attachment #348078 - Attachment description: Disable all BACK/FORWARD UI and logic when disablehistory="true". → Disable all BACK/FORWARD UI and logic when disablehistory="true" [Checkin: Comment 20]
Comment on attachment 349127 [details] [diff] [review]
Make disablehistory="true" in Thunderbird view-source
[Checkin: Comment 21]

http://hg.mozilla.org/comm-central/rev/4211efe014b4
Attachment #349127 - Attachment description: Make disablehistory="true" in Thunderbird view-source → Make disablehistory="true" in Thunderbird view-source [Checkin: Comment 21]
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Whiteboard: [c-n: (m-c patch) baking for 1.9.1]
Target Milestone: --- → mozilla1.9.2a1
Comment on attachment 348078 [details] [diff] [review]
Disable all BACK/FORWARD UI and logic when disablehistory="true"
[Checkin: Comment 20 & 23]

http://hg.mozilla.org/releases/mozilla-1.9.1/rev/e1489e75e0e5
Attachment #348078 - Attachment description: Disable all BACK/FORWARD UI and logic when disablehistory="true" [Checkin: Comment 20] → Disable all BACK/FORWARD UI and logic when disablehistory="true" [Checkin: Comment 20 & 23]
Whiteboard: [c-n: (m-c patch) baking for 1.9.1]
Target Milestone: mozilla1.9.2a1 → mozilla1.9.1b3
Flags: in-testsuite?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: