Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toolbar button can't be placed on Navigation Toolbar in Firefox 29+ (Australis) #121

Closed
Infocatcher opened this issue Nov 20, 2013 · 1 comment

Comments

@Infocatcher
Copy link
Owner

No description provided.

@Infocatcher
Copy link
Owner Author

Also there is a bug with
resource:///modules/CustomizableUI.jsm

  getUnusedWidgets: function(aWindowPalette) {
    ...
    for (let node of aWindowPalette.children) {
      LOG("In palette children: " + node.id);
      if (node.id && !this.getPlacementOfWidget(node.id)) {
        widgets.add(node.id);
      }
    }
  getPlacementOfWidget: function(aWidgetId, aOnlyRegistered) {
    ...
    for (let [area, placements] of gPlacements) {
      let index = placements.indexOf(aWidgetId);
      if (index != -1) {
        return { area: area, position: index };
      }
    }

    return null;
  },

If something went wrong, buttons from restartless extensions may disappear at all (still in palette, but not visible in UI).

Ugly workaround:

var scope = Cu.import("resource:///modules/CustomizableUI.jsm", {});
var gPlacements = scope.gPlacements;
//gPlacements.clear();
for(var [area, placements] of scope.gPlacements) {
    var toolbar = document.getElementById(area);
    if(!toolbar || toolbar.localName != "toolbar")
        continue;
    gPlacements.set(area, toolbar.currentSet.split(","));
}
scope.gDirty = true;
scope.CustomizableUIInternal.saveState();

(and restart)
This will be saved in browser.uiCustomization.state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant