剪切,复制和粘贴不适用于Firefox 15单词吗? [英] Cut,Copy and paste is not working for firefox 15 onwords?

查看:282
本文介绍了剪切,复制和粘贴不适用于Firefox 15单词吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect')用于Firefox.

I am using the netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect') for firefox.

我正面临浏览器与编辑器兼容性的问题.我们正在使用HTML EDITOR.

i am facing the problem for browser compatability for editor. we are using HTML EDITOR.

在IE中,所有版本的剪切,复制和粘贴均适用于此编辑器.

In IE all version cut, copy and paste is working for this editor.

在谈到mozilla时,它们仅在某些版本上有效.在Firefox 15上无法正常工作....

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( /\n/g, '<br/>' ) ;
window.activeEditor._inserthtml( code ) ;
};

谢谢...

推荐答案

我们需要使用about:config不加引号来添加一些特权.

we need to add some privileges using about:config with out quotation.

user_pref("capability.policy.policynames","allowclipboard"); user_pref("capability.policy.allowclipboard.sites"," https://www.mozilla.org "); user_pref("capability.policy.allowclipboard.Clipboard.cutcopy","allAccess"); user_pref("capability.policy.allowclipboard.Clipboard.paste","allAccess");

user_pref("capability.policy.policynames", "allowclipboard"); user_pref("capability.policy.allowclipboard.sites", "https://www.mozilla.org"); user_pref("capability.policy.allowclipboard.Clipboard.cutcopy", "allAccess"); user_pref("capability.policy.allowclipboard.Clipboard.paste", "allAccess");

这篇关于剪切,复制和粘贴不适用于Firefox 15单词吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆