I am using the netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect') for firefox.
i am facing the problem for browser compatability for editor. we are using HTML EDITOR.
In IE all version cut, copy and paste is working for this editor.
when comes to mozilla, these are working only upto some versions only. it is not working in firefox 15 onwords....
when i right click, the cut, copy and paste are disabled. eventhough shotcut keys are also not working.
can any one know this? please clarify above issues ASAP.
we are using for this copy the selected text. here is a sample code for this:
PasteText.prototype.execute = function()
{
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
if (!clip) {
return;
}
var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
if (!trans) {
return;
}
trans.addDataFlavor('text/unicode');
clip.getData(trans,clip.kGlobalClipboard);
var str = new Object();
var len = new Object();
try {
trans.getTransferData('text/unicode',str,len);
}
catch(error) { return; }
if (str) {
if (Components.interfaces.nsISupportsWString) {
str=str.value.QueryInterface(Components.interfaces.nsISupportsWString);
} else if (Components.interfaces.nsISupportsString) {
str=str.value.QueryInterface(Components.interfaces.nsISupportsString);
} else {
str = null;
}
}
if (str) {
var code = str.data.substring(0,len.value / 2);
}
code = code.replace( /
/g, '<br/>' ) ;
window.activeEditor._inserthtml( code ) ;
};
Thank you...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…