Firefox has a number of development tools that can be used to help with the development of Social API providers. However, until bug 839959 lands the process isn't as simple as it should be. In the meantime, this page describes some workarounds.
Both of the techniques below require the chrome devtools to be manually enabled. To do this, open about:config
in a tab, and after verifying that you will be careful, toggle the boolean value devtools.chrome.enabled
to true.
// Uncomment one of the following lines. NOTE: You must ensure the element you // want to inspect has been created - e.g., the sidebar must be visible, the flyouts // must have been opened once, etc. // The sidebar let w = document.getElementById("social-sidebar-browser").contentWindow; // The "flyout" panel // let w = document.getElementById("social-flyout-panel").firstChild.contentWindow; // The "notification" panel - this will show the most-recently-used panel // let w = document.getElementById("social-notification-panel").firstChild.contentWindow; if (!w) { alert("This window is yet to be created"); } else { XPCOMUtils.defineLazyModuleGetter(this, "Toolbox", "resource:///modules/devtools/Toolbox.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "TargetFactory", "resource:///modules/devtools/Target.jsm"); let target = TargetFactory.forWindow(w); let toolbox = gDevTools.getToolbox(target); toolbox ? toolbox.destroy() : gDevTools.showToolbox(target, undefined, "window"); }
let w = ...
" lines is uncommented, depending on which social element you wish to inspect.// want to inspect has been created - eg, the sidebar must be visible, the flyouts // must have been opened once, etc. // The sidebar: let w = document.getElementById("social-sidebar-browser").contentWindow; // The "flyout" panel. // let w = document.getElementById("social-flyout-panel").firstChild.contentWindow // The "notification" panel - this will show the most-recently-used panel. // let w = document.getElementById("social-notification-panel").firstChild.contentWindow; if (!w) { alert("This window is yet to be created"); } else { XPCOMUtils.defineLazyModuleGetter(this, "Toolbox", "resource:///modules/devtools/Toolbox.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "TargetFactory", "resource:///modules/devtools/Target.jsm"); let target = TargetFactory.forWindow(w); let toolbox = gDevTools.getToolbox(target); toolbox ? toolbox.destroy() : gDevTools.showToolbox(target, undefined, "window"); }
// Uncomment one of the following lines. NOTE: You must ensure the element you // want to inspect has been created - eg, the sidebar must be visible, the flyouts // must have been opened once, etc. // The sidebar: let w = document.getElementById("social-sidebar-browser").contentWindow; // The "flyout" panel. // let w = document.getElementById("social-flyout-panel").firstChild.contentWindow // The "notification" panel - this will show the most-recently-used panel. // let w = document.getElementById("social-notification-panel").firstChild.contentWindow; if (!w) { alert("This window is yet to be created"); } else { XPCOMUtils.defineLazyModuleGetter(this, "Toolbox", "resource:///modules/devtools/Toolbox.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "TargetFactory", "resource:///modules/devtools/Target.jsm"); let target = TargetFactory.forWindow(w); let toolbox = gDevTools.getToolbox(target); toolbox ? toolbox.destroy() : gDevTools.showToolbox(target, undefined, "window"); }
// Uncomment one of the following lines. NOTE: You must ensure the element you // want to inspect has been created - eg, the sidebar must be visible, the flyouts // must have been opened once, etc. // The sidebar: let w = document.getElementById("social-sidebar-browser").contentWindow; // The "flyout" panel. // let w = document.getElementById("social-flyout-panel").firstChild.contentWindow // The "notification" panel - this will show the most-recently-used panel. // let w = document.getElementById("social-notification-panel").firstChild.contentWindow; if (!w) { alert("This window is yet to be created"); } else { XPCOMUtils.defineLazyModuleGetter(this, "Toolbox", "resource:///modules/devtools/Toolbox.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "TargetFactory", "resource:///modules/devtools/Target.jsm"); let target = TargetFactory.forWindow(w); let toolbox = gDevTools.getToolbox(target); toolbox ? toolbox.destroy() : gDevTools.showToolbox(target, undefined, "window"); }
// Uncomment one of the following lines. NOTE: You must ensure the element you // want to inspect has been created - eg, the sidebar must be visible, the flyouts // must have been opened once, etc. // The sidebar: let w = document.getElementById("social-sidebar-browser").contentWindow; // The "flyout" panel. // let w = document.getElementById("social-flyout-panel").firstChild.contentWindow // The "notification" panel - this will show the most-recently-used panel. // let w = document.getElementById("social-notification-panel").firstChild.contentWindow; if (!w) { alert("This window is yet to be created"); } else { XPCOMUtils.defineLazyModuleGetter(this, "Toolbox", "resource:///modules/devtools/Toolbox.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "TargetFactory", "resource:///modules/devtools/Target.jsm"); let target = TargetFactory.forWindow(w); let toolbox = gDevTools.getToolbox(target); toolbox ? toolbox.destroy() : gDevTools.showToolbox(target, undefined, "window"); }