0

How do I hide the Titlebar of a sidebar in the Firefox Add-on SDK?

I created a simple sidebar using: ui/sidebar, but I want to hide the titlebar. Is there any way to get rid of this?

titlebar

On WebAPI I saw is possible, but in Firefox SDK, I didn't see any information.

Here is the code in order to create the Sidebar:

//Sidebar
var sidebar = require("sdk/ui/sidebar").Sidebar({
    id: 'sidebar',
    title: 'Sidebar',
    url: require("sdk/self").data.url("sidebar.html"),
    onAttach: function(worker) {
    //
    },
        onShow: function() {
            console.log("showing");
        },
        onHide: function() {
        console.log("hiding");
    },
    onDetach: function() {
        console.log("detaching");
    }
});
  • 1
    Please [edit] your question to be on-topic: Questions seeking debugging help ("**why isn't this code working?**") 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 [How do I ask a good question?](http://stackoverflow.com/help/how-to-ask). – Makyen Nov 15 '16 at 09:01
  • In this case, by [mcve], I mean the code to create a simple sidebar as you are currently doing it. – Makyen Nov 15 '16 at 09:02
  • The reason that a [mcve] is required is that *we want to help*. It is **much** easier to help if we don't have to recreate all the code needed to duplicate the problem. This is code that you already have. So, please help us to help you and provide a *complete* [mcve] that duplicates the problem with such questions. Without a [mcve] the amount of effort required to even begin to help you is **much** higher which *significantly* reduces the number of people willing/able to help you. Even if we put out the extra effort, we have to *guess* at significant portions of what your problem might be. – Makyen Nov 15 '16 at 09:03
  • I assume you have tried both not having a `title` property and having a `title` property that is `''`. Correct? Both did not do what you want. Correct? Assuming those did not work, then the answer is: Yes, it can be done, but you have to modify the XUL structure of the Chrome window DOM. Certainly doable in an SDK add-on, but doing so goes around the SDK and accesses XUL directly. This will mean your add-on is less forward-compatible (i.e. more likely to break in future versions of Firefox). – Makyen Nov 15 '16 at 09:09
  • Sorry, and thanks for all those tips. Answering about the question. Yes i tried `title` property with `' '` but Sidebar title still there. Kinda frustrated about Firefox Addon-SDK, after announce will not support next year, wanna move to Web Extension. I choose Firefox SDK since Sidebar is not supported on Google Chrome, but this give me more pain, because can not embed external content into sidebar, just local html and actually I am building the sidebar with API request. I saw some examples about Sidebar in WebExtension but its kinda hard to understand, and didn't find docs too. –  Nov 21 '16 at 21:13

0 Answers0