Closed
Bug 389239
Opened 19 years ago
Closed 19 years ago
cant invoke a dragsession starting from 2.0.0.5 from remote/unprivileged code
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: jan, Unassigned)
Details
(Keywords: regression)
Attachments
(1 file)
|
1.39 KB,
application/vnd.mozilla.xul+xml
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.5) Gecko/20070713 Firefox/2.0.0.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.5) Gecko/20070713 Firefox/2.0.0.5
In FF 2.0.0.4 and before we used to be able to invoke a dragSession (invokeDragSession) from remote/unprivileged code by setting 'signed.applets.codebase_principal_support' to true and requesting UniversalXPConnect privileges.
This suddenly stopped working in FF 2.0.0.5 and throws an 'Error: uncaught exception: Permission denied to get property UnnamedClass.classes' in the error console.
Reproducible: Always
Steps to Reproduce:
1. call the function dragStart as listed below from any element you want to drag by adding 'ondraggesture="dragStart(event)"' to that element
2. make sure you have set 'signed.applets.codebase_principal_support' to true in your config
3. try to drag, error throws at ds.invokeDragSession(...
method dragStart
----------------------
function dragStart(event){
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
}catch(err){
alert("To allow dragging you should set 'signed.applets.codebase_principal_support' to true in your browser settings (surf to about:config)");
return false;
}
var ds = Components.classes["@mozilla.org/widget/dragservice;1"].getService(Components.interfaces.nsIDragService);
// alert(event.target.tagName);
var trans = Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);
trans.addDataFlavor("text/unicode");
var textWrapper = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
textWrapper.data = "Some data";
trans.setTransferData("text/unicode", textWrapper, textWrapper.data.length);
var transArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
transArray.AppendElement(trans);
ds.invokeDragSession(event.target, transArray, null, ds.DRAGDROP_ACTION_COPY + ds.DRAGDROP_ACTION_MOVE);
event.stopPropagation();
}
Actual Results:
throws an error 'Error: uncaught exception: Permission denied to get property UnnamedClass.classes' in the error console.
Expected Results:
no error on calling ds.invokeDragSession(...
Updated•19 years ago
|
Keywords: regression
Version: unspecified → 2.0 Branch
Comment 1•19 years ago
|
||
Is it possible for you to attach a minimal testcase that shows this bug ("Add an attachment")? If so, I'd be happy to find the regression range and the bug that caused this problem.
Comment 2•19 years ago
|
||
This is worksforme, using:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.5) Gecko/20070713 Firefox/2.0.0.5
| Reporter | ||
Comment 3•19 years ago
|
||
Sorry, Martijn is right, this is not a bug. My problem as described above turned out to be caused by not asking for UniversalXPConnect privileges in the dragEnter, dragOver en dragDrop.
Apparently asking for UnXPXonnect privileges only on draggesture worked for previous versions but the new behaviour of 2.0.0.5 shouldn't be a problem.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•