experimented with some extension, and I wanted to after pressing the button that opens a new tab is pinned. So I decided to open a new tab and change the attribute pinned="true" I think they look like the code getMainWindow().getBrowser().addTab(site.url).setAttribute("pinned", true) It is a bit incorrect solution because I found pinTab() which works fine. But I think that bug and it should be resolved.
You need to use pinTab. setAttribute isn't a supported way to do this.