Bug 866381 - allow inspector to be used on chrome windows, r=dcamp

This commit is contained in:
Gijs Kruitbosch 2013-04-29 19:32:12 +02:00
parent 28464ba636
commit 97bf6d8ae6

View File

@ -184,6 +184,14 @@ InspectorPanel.prototype = {
* Hooks the searchbar to show result and auto completion suggestions.
*/
setupSearchBox: function InspectorPanel_setupSearchBox() {
let searchDoc;
if (this.target.isLocalTab) {
searchDoc = this.browser.contentDocument;
} else if (this.target.window) {
searchDoc = this.target.window.document;
} else {
return;
}
// Initiate the selectors search object.
let setNodeFunction = function(node) {
this.selection.setNode(node, "selectorsearch");
@ -193,9 +201,7 @@ InspectorPanel.prototype = {
this.searchSuggestions = null;
}
this.searchBox = this.panelDoc.getElementById("inspector-searchbox");
this.searchSuggestions = new SelectorSearch(this.browser.contentDocument,
this.searchBox,
setNodeFunction);
this.searchSuggestions = new SelectorSearch(searchDoc, this.searchBox, setNodeFunction);
},
/**