Can't get xpi to work in TorBrowser

127 Views Asked by At

I created a small little HelloWorld extension and was able to get it to work in Firefox 31 (which TorBrowser is based on). However I'm unable to get it to work in TorBrowser. Any idea why that might be and how I can fix? This is my 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.

1

There are 1 best solutions below

0
On BEST ANSWER

Had to add "permissions": {"private-browsing": true} to the package.json

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