Closed Bug 32661 Opened 24 years ago Closed 24 years ago

nsIChromeRegistry.reloadChrome() leaves chrome in a state where access to XPConnect is denied

Categories

(Core Graveyard :: RDF, defect, P3)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: mj, Assigned: hyatt)

References

Details

(Whiteboard: [nsbeta2-] [need info] [nsbeta3+])

Attachments

(3 files)

Calling nsIChromeRegistry.reloadChrome() to reload the chrome, causes the
reloaded chrome to have no access to XPConnect.
Attached file Testcase
To reproduce:

1. save (second, correct) testcase in chrome/test/content/default/6741.xul
2. fire up mozilla -chrome chrome://test/content/6741.xul
3. click Test->Reload
4. Mozilla reloads chrome.
5. click Test->Reload
6. Console gives "JavaScript Error: uncaught exception: Access denied to
XPConnect service."

Expected mozilla to reload chrome again.

Oops, additional info: moz build 2000030708
Cancel that last comment, I use my own dail y build from the tip, and the build
number isn't updated... =/
Status: NEW → ASSIGNED
Whiteboard: no estimate
Target Milestone: --- → M17
Target Milestone: M17 → M16
This bug needs to be fixed so enable dynamic locale switching
Blocks: 34145
nominating on nsbeta2
Keywords: nsbeta2, skins
QA Contact: nobody → jrgm
[nsbeta2-],please renominate if there are scenarios where a user could 
encounter this.
Whiteboard: no estimate → [nsbeta2-] no estimate
FYI, this function gets called in swiching locale providers on the fly.
movig from architecture to browser product
Product: Architecture → Browser
Version: 5.0 → other
Mass-moving nsbeta2- bugs to M20
Target Milestone: M16 → M20
Blocks: 42391
I found out that probably reloadChrome() doesn't cause problem itself, but
problem occurs when getService is evaluated twice
I think problem is in reloading of DOM window.
Access to XPConnect is only granted for pages with URL like:
chrome://xxx/content/page.xul
After loading this page, URL is translated to real filesystem path like:
file:///home/user/mozilla/dist/bin/chrome/packages/xxx/xxx/content/page.xul
That URL does not have access to XPConnect and that cause entire problem
probably.
need info: how would an NS6 user see this (steps to repro), and what exactly is
the state of the app once they do?  Time to either nominate for nsbeta3 (with a
compelling argument for fixing this rather than some other bug we've already
committed to fix), or retarget to Future.
Whiteboard: [nsbeta2-] no estimate → [nsbeta2-] [need info]
I think this is needed for:

1. dynamic switching locales when it will be hooked (according to Tao comments)
2. developers need this for debugging their UI

I don't know if this is important for nsbeta3, but now developers must disable
XUL cache when developing UI
I have fix for this bug...

mozilla/docshell/base/nsDocShell.cpp on line 3273
-aChannel->GetURI(getter_AddRefs(uri));
+aChannel->GetOriginalURI(getter_AddRefs(uri));

Not well tested at the moment.
Keywords: patch
[nsbeta3+] : Thank You, Jan Varga!
Whiteboard: [nsbeta2-] [need info] → [nsbeta2-] [need info] [nsbeta3+]
Target Milestone: M20 → Future
pulling '+' bug back from Future to M18 (as I believe was intended).
OS: Linux → All
Hardware: PC → All
Target Milestone: Future → M18
Adding nsbeta3 keyword to bugs which already have nsbeta3 status markings so 
the queries don't get all screwed up.
Keywords: nsbeta3
Attached patch proposed patchSplinter Review
Fixed.

Thanks Jan!
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
verified that the patch is in the tree in version 1.180.
Status: RESOLVED → VERIFIED
Keywords: skins
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: