Just to clarify, what feature are you trying to implement that needs permission from the user?

Nick wrote:
My PC Setup:
- Win2K Server SP4 w/ Certificates Authority enabled
-Netscape 7.1

When run locally as a Chrome app:
I have already tested a drag drop XUL app from the Netscape Chrome dir
and it works fine. (See code below)

When run remotely:
-I am now running it from a secure server, i.e. https://, so it is
signed.
-The certificates from the site are valid and were accepted so the
site is trusted. I have verified this in the preferences under "Manage
Certificates"
-I'm prompted from my XUL app to enable enhanced privileges for
UniversalXPConnect.
-I say "yes" to the prompt and check it as well so as not to be asked
again.
-I try dragging a widget and I get the famous security error "Error:
uncaught exception:      Permission denied to get property
UnnamedClass.classes"

I have this line in my prefs.js as suggested by XULPlanet.com for
signed apps:
user_pref("signed.applets.codebase_principal_support", true);

Also once I click yes on the prompt for enhanced privileges it adds
the following two lines to prefs.js:
user_pref("capability.principal.codebase.p0.granted",
"UniversalXPConnect");
user_pref("capability.principal.codebase.p0.id",
"https://webserver_name";);

This is really frustrating because I need to serve pages that can
access XPCOM. If this is not possible I will have to go back to IE
which would be a shame because Mozilla/XUL has so many cool things in
it.

Any help can be sent to [EMAIL PROTECTED] or you can reply to the
following post on XULPlanet.com
(http://xulplanet.com/forum/viewtopic.php?t=280) to shed some light on
the subject for visitors of that site.

Code
----
dragdrop.xul:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window title="Widget Dragger" id="test-window"
orient="horizontal"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
onload="netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');">
<script src="chrome://global/content/nsDragAndDrop.js"/>
<script src="chrome://global/content/nsTransferable.js"/> <script src="dragboard.js"/>
<stack id="board"
style="border-style: solid;width:300px; height: 300px; max-width:
300px; max-height: 300px"
ondragover="nsDragAndDrop.dragOver(event,boardObserver)"
ondragdrop="nsDragAndDrop.drop(event,boardObserver)">
</stack>
<vbox>
<button label="Button" elem="button"
ondraggesture="nsDragAndDrop.startDrag(event,listObserver)"/>
<button label="Check Box" elem="checkbox"
ondraggesture="nsDragAndDrop.startDrag(event,listObserver)"/>
<button label="Text Box" elem="textbox"
ondraggesture="nsDragAndDrop.startDrag(event,listObserver)"/>
</vbox>
</window>


dragboard.js:
var listObserver = { onDragStart: function (evt,transferData,action){
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var txt=evt.target.getAttribute("elem");
transferData.data=new TransferData();
transferData.data.addDataForFlavour("text/unicode",txt);
}
};


var boardObserver = {
  getSupportedFlavours : function () {
        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    var flavours = new FlavourSet();
    flavours.appendFlavour("text/unicode");
    return flavours;
  },
  onDragOver: function
(evt,flavour,session){netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");},
  onDrop: function (evt,dropdata,session){
        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    if (dropdata.data!=""){
      var elem=document.createElement(dropdata.data);
      evt.target.appendChild(elem);
      elem.setAttribute("left",""+evt.pageX);
      elem.setAttribute("top",""+evt.pageY);
      elem.setAttribute("label",dropdata.data);
    }
  }
};
_______________________________________________
Mozilla-security mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-security

Reply via email to