0

I need help with Firefox plugin sidebar: sdk/ui/sidebar

var sidebars = require("sdk/ui/sidebar"),
    ...

    var orderSidebar = sidebars.Sidebar({
  id: "order-sidebar",
  title: "clix Sidebar",
  url: self.data.url("html/order-sidebar.html"),
  onHide: function () {
    mainToggleButton.setToggle(false);
  }
});

orderSidebar.on("ready", function (worker) {
  worker.port.on("orderClicked", handleOrderClicked);
  worker.port.emit("orderArrival", orderData);
  orderSidebarWorker = worker;
});

The Firefox add-on shows as a sidebar, but I want to make it show in a tab or window.

I want to change the ui/sidebar command to a window or tab by that making the plugin.

Eldelshell
  • 6,683
  • 7
  • 44
  • 63
  • your snippet isnt working – leoap Jan 02 '17 at 18:17
  • @leo_ap, it should not be a snippet. What is show is code for a Firefox Add-on SDK extension which has no possibility to be functional as a snippet. – Makyen Jan 02 '17 at 18:18
  • What you want to do is unclear. It *sounds* like what you want is to open the URL for the HTML you are using for the sidebar as either a tab, or a window. Doing so will require rewriting some of your code to work without the methods provided by the `sdk/ui/sidebar` API. – Makyen Jan 02 '17 at 18:25
  • Please [edit] your question to be on-topic: Questions seeking debugging help ("**why isn't this code working the way I want?**") must include: ►the desired behavior, ►a specific problem or error *and* ►the shortest code necessary to reproduce it **in the question itself**. Questions without a clear problem statement are not useful to other readers. See: [**How to create a Minimal, Complete, and Verifiable Example**](http://stackoverflow.com/help/mcve), [What topics can I ask about here?](http://stackoverflow.com/help/on-topic), and [ask]. – Makyen Jan 02 '17 at 18:25
  • Related: [Firefox SDK Add-on with a sidebar on both the right and left at the same time](http://stackoverflow.com/q/34357582/3773011) – Makyen Jan 02 '17 at 18:27

0 Answers0