--- title: Utilizar Firefox Devtools com a API Social slug: Archive/Devtools_API_Social translation_of: Archive/Social_API_Devtools ---
O Firefox tem um número de ferramentas de desenvolvimento que podem ser utilizadas para ajudar com o desenvolvimento dos provedores de API Social. Contudo, até que o bug 839959 termine, o processo não é tão simples como deveria ser. Enquanto isso, esta página descreve algumas soluções alternativas.
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");
}
// 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");
}