diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-08 15:06:43 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-08 15:06:43 +0200 |
commit | 97238e0f4308809dcca9af739d679ba29889405a (patch) | |
tree | 2d7fbbc178b7409189dd7f553643930a0455735b /application/palemoon/base | |
parent | 0e6c1d1dc32ea14841bd7f834cd9e9f1f5e62408 (diff) | |
download | UXP-97238e0f4308809dcca9af739d679ba29889405a.tar UXP-97238e0f4308809dcca9af739d679ba29889405a.tar.gz UXP-97238e0f4308809dcca9af739d679ba29889405a.tar.lz UXP-97238e0f4308809dcca9af739d679ba29889405a.tar.xz UXP-97238e0f4308809dcca9af739d679ba29889405a.zip |
[PALEMOON] [DevTools] Fix a function "Inspect Element" (nsContextMenu.js)
Issue #102
Diffstat (limited to 'application/palemoon/base')
-rw-r--r-- | application/palemoon/base/content/nsContextMenu.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/application/palemoon/base/content/nsContextMenu.js b/application/palemoon/base/content/nsContextMenu.js index 8e6bc96c2..f914f5841 100644 --- a/application/palemoon/base/content/nsContextMenu.js +++ b/application/palemoon/base/content/nsContextMenu.js @@ -422,12 +422,17 @@ nsContextMenu.prototype = { }, inspectNode: function CM_inspectNode() { - let {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}); + let {devtools} = Cu.import("resource://devtools/shared/Loader.jsm", {}); let gBrowser = this.browser.ownerDocument.defaultView.gBrowser; - let tt = devtools.TargetFactory.forTab(gBrowser.selectedTab); - return gDevTools.showToolbox(tt, "inspector").then(function(toolbox) { + let target = devtools.TargetFactory.forTab(gBrowser.selectedTab); + + return gDevTools.showToolbox(target, "inspector").then(function(toolbox) { let inspector = toolbox.getCurrentPanel(); - inspector.selection.setNode(this.target, "browser-context-menu"); + + this.browser.messageManager.sendAsyncMessage("debug:inspect", {}, {node: this.target}); + inspector.walker.findInspectingNode().then(nodeFront => { + inspector.selection.setNodeFront(nodeFront, "browser-context-menu"); + }); }.bind(this)); }, |