If your xul file access some privilege you access it thru a chrome:// url.
In the panels.rdf in profile directory, you can see :
<RDF:Description about="urn:sidebar:panel:whats-related">
     <NC:title>&sidebar.whats-related.label;</NC:title>
<NC:content>chrome://communicator/content/related/related-panel.xul</NC:content>
   </RDF:Description>

The xul file is access as a content chrome resource, it automaticaly 
gain privilege.content,

if your xul is mysidebar.xul.

In your case, you have to :
1 - put your file in a folder inside the mozilla/chrome directory,
mozilla/chrome/mysidebar/mysidebar.xul
(you can have js file too)
mozilla/chrome/mysidebar/mysidebar.js

2 - write a nice contents.rdf (the most difficult),
mozilla/chrome/mysidebar/contents.rdf :
   <?xml version="1.0"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
          xmlns:chrome="http://www.mozilla.org/rdf/chrome#";>

<RDF:Seq about="urn:mozilla:package:root">
<RDF:li resource="urn:mozilla:mysidebar"/>
</RDF:Seq>

<RDF:Description about="urn:mozilla:package:mysidebar"
         chrome:displayName="My SideBar"
         chrome:author="you"
         chrome:name="mysidebar">
</RDF:Description>
</RDF:RDF>

3 - declare the path to your folder
add the following line in the mozilla/chrome/installed-chrome.txt file,
  install,url,resource:/chrome/mysidebar

4 - maybe delete the *.rdf files, then launch mozilla :

5 - Now your xul file is accessible with a chrome:// url. enjoy

David Olivari
eProcess


Robert Cook wrote:
> The "What's Related" sidebar has a capability I'd like to build into a new
> sidebar.  I want to automatically update the content of my sidebar when the
> URL of the main window changes.  The best solution would be to use
> javascript and XPConnect, but I can see how that could be a security
> Pandora's box.   If not, what would you suggest?
> 
> Thanks,
> 
> Robert Cook
> 
> ------------------------
> I'm copying a post from last year that asks a similar question which
> received no responses:
> 
> From: Matt Martel <[EMAIL PROTECTED]>
> Subject: Sidebars and XPConnect
> Date: 2000/05/12
> Message-ID: <[EMAIL PROTECTED]>#1/1
> Content-Transfer-Encoding: 7bit
> Organization: Another Netscape Collabra Server User
> X-Accept-Language: en
> Content-Type: text/plain; charset=us-ascii; format=flowed
> User-Agent: Mozilla/5.0 (Windows; N; WinNT4.0; en-US; m14) Netscape6/6.0b1
> Mime-Version: 1.0
> Newsgroups: netscape.public.dev.mysidebar,netscape.public.mozilla.xpcom
> 
> 
> I am trying to use the observer service in my sidebar page code. This
> mimics the "What's Related" functionality, in that it wants to be
> notified when the browser navigates to a new location. I've even
> borrowed some of the related-panel.js code, with some success. Until
> recently I could bypass the XPConnect security issue by setting
> security.checkxpconnect to false in prefs.js. Now this no longer works,
> and I cannot successfully enable the UniversalXPConnect privelege within
> my sidebar javascript code.
> 
> I guess the real question is, how does this work for the "What's
> Related" code? I don't see anything special to allow related-panel.js to
> access the observer service. Any info would be appreciated.
> 
> --
> Matt Martel
> [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> 



Reply via email to