简体   繁体   English

无法使xpi在TorBrowser中工作

[英]Can't get xpi to work in TorBrowser

I created a small little HelloWorld extension and was able to get it to work in Firefox 31 (which TorBrowser is based on). 我创建了一个小的HelloWorld扩展,并使其能够在Firefox 31(基于TorBrowser的Firefox 31)上工作。 However I'm unable to get it to work in TorBrowser. 但是我无法使其在TorBrowser中工作。 Any idea why that might be and how I can fix? 知道为什么会这样以及如何解决吗? This is my main.js 这是我的main.js

var contextMenu = require("sdk/context-menu");
var menuItem = contextMenu.Item({
    label: "Log Selection",
    context: contextMenu.SelectionContext(),
    contentScript: 'self.on("click", function () {' +
        '  var text = window.getSelection().toString();' +
        '  self.postMessage(text);' +
        '});',
    onMessage: function (selectionText) {
    console.log(selectionText);
}
});

The context menu item shows up in FF but not TB. 上下文菜单项以FF显示,但不以TB显示。

Had to add "permissions": {"private-browsing": true} to the package.json 必须在package.json中添加"permissions": {"private-browsing": true}

https://tor.stackexchange.com/questions/6293/sidebar-for-custom-addon-broken-in-tbb https://tor.stackexchange.com/questions/6293/sidebar-for-custom-addon-broken-in-tbb

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM