Closed Bug 1157906 Opened 9 years ago Closed 9 years ago

Inspect element button is not showing up in the Browser Toolbox or in WebIDE

Categories

(DevTools :: Framework, defect, P1)

defect

Tracking

(firefox40 fixed)

RESOLVED FIXED
Firefox 40
Tracking Status
firefox40 --- fixed

People

(Reporter: bgrins, Assigned: jryans)

References

Details

(Keywords: regression, Whiteboard: [polish-backlog][difficulty=easy])

Attachments

(3 files)

Just noticed this today - the Inspect Element button isn't showing up in the Browser Toolbox.  It's 'checked' in the Options panel, and shows up if I toggle it again but it's missing on startup.
Blocks: 1128988
For symmetry with main.js, I did https://dxr.mozilla.org/mozilla-central/source/toolkit/devtools/Loader.jsm#82, so I guess the loader used for the browser toolbox doesn't respect this for some reason.
Copying in comments from other bug:

Somehow this has caused the Inspect Element button to disappear in the Browser Toolbox (Bug 1157906).  Looks like it may be a loader issue?

Module `definitions` is not found at resource://gre/modules/commonjs/definitions.js

"@resource:///modules/devtools/commandline/commands-index.js:82:22GcliActor<._getRequisition@resource://gre/modules/devtools/server/actors/gcli.js:245:22GcliActor<.specs<@resource://gre/modules/devtools/server/actors/gcli.js:96:12actorProto/</handler@resource://gre/modules/devtools/server/protocol.js:1006:19DSC_onPacket@resource://gre/modules/devtools/server/main.js:1456:15DebuggerTransport.prototype._onJSONObjectReady/<@resource://gre/modules/devtools/transport/transport.js:471:9makeInfallible/<@resource://gre/modules/devtools/DevToolsUtils.js:82:14makeInfallible/<@resource://gre/modules/devtools/DevToolsUtils.js:82:14"
FYI, to run the Browser Toolbox in a separate window so you can see logs, you can open up a normal BT on  so that the server starts and then run a separate command:

./mach run --profile /tmp/foobar -chrome chrome://browser/content/devtools/framework/toolbox-process-window.xul --purgecaches --jsconsole
What happens if we do:

  const defaultTools = require("resource:///modules/devtools/definitions.js").defaultTools;
(In reply to Joe Walker [:jwalker] (overloaded - needinfo me or ping on irc) from comment #5)
> What happens if we do:
> 
>   const defaultTools =
> require("resource:///modules/devtools/definitions.js").defaultTools;

I'm seeing this error after doing that (it seems to be clipped off in browser console though):

onPacket threw an exception: Error: Server did not specify an actor, dropping packet: [{"item":"command","name":"pref","params":[],"isParent":true,"description":"Commands to control settings","manual":"Commands to display and alter preferences both for GCLI and the surrounding environment"},{"item":"command","name":"tilt","params":[],"isParent":true,"description":"Visualize the webpage in 3D","manual":"Investigate the relationship between various parts of a webpage and their ancestors in a 3D environment","hidden":true},{"item":"command","name":"tilt open","params":[],"isParent":false,"description":"Open the Inspector 3D view","manual":"Initialize the 3D page inspector and optionally highlight a node using a CSS selector","hidden":true},{"item":"command","name":"tilt toggle","params":[],"isParent":false,"hidden":true,"buttonId":"command-button-tilt","buttonClass":"command-button command-button-invertable","tooltipText":"3D View"},{"item":"command","name":"tilt translate","params":[{"na
Attached file gcli-error-log.txt
Here's the full log from Comment 6
OK so I think the loader thing was a mistake in my first test - I probably just hadn't fully built before running the BT process (or the cache hadn't been properly cleared, or something).  I think Comment 7 is the actual problem
GcliActor is a child of the tab actor, that feels like it could cause this?
I just duped bug 1158248 to this because there were significant similarities: "onPacket threw an exception: Error: Server did not specify an actor, dropping packet", but it's possible they don't actually have the same root cause.
If when we fix this, the other isn't fixed, then we should undupe it.
This is also affecting simulators connected via WebIDE:

onPacket threw an exception: Error: Server did not specify an actor, dropping packet: {"error":"unknownError","message":"Error occurred while creating actor 'undefined: TypeError: browser is undefined\nStack: exports.GcliActor<.initialize@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/gcli.js:1:952\nconstructor@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/core/heritage.js:16:80\nObservedActorFactory.prototype.createActor@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/common.js:13:99\nDebuggerServerConnection.prototype._getOrCreateActor@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/main.js:83:53\nDSC_onPacket@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/main.js:93:11\nChildDebuggerTransport.prototype.receiveMessage@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/transport/transport.js:38:337\nLine: 1, column: 951"}
Stack: DebuggerClient.prototype.onPacket@resource://gre/modules/devtools/dbg-client.jsm:944:1
DebuggerTransport.prototype._onJSONObjectReady/<@resource://gre/modules/devtools/dbg-client.jsm -> resource://gre/modules/devtools/transport/transport.js:471:9
makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/DevToolsUtils.js:82:14
makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/DevToolsUtils.js:82:14
Line: 944, column: 0
Keywords: regression
Priority: -- → P1
Summary: Inspect element button is not showing up in the Browser Toolbox → Inspect element button is not showing up in the Browser Toolbox or in WebIDE
I'll attempt to see if I can fix this.
Assignee: nobody → jryans
Status: NEW → ASSIGNED
Whiteboard: [devedition-40]
Whiteboard: [devedition-40] → [devedition-40][difficulty=easy]
Comment on attachment 8598292 [details] [diff] [review]
0001-Bug-1157906-Can-t-return-arrays-as-a-root-response-f.patch

Review of attachment 8598292 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM!
Attachment #8598292 - Flags: review?(bgrinstead) → review+
Nit, why not just: 

 return this._getRequisition().then(
   requisition => requisition.system.commands.getCommandSpecs(customProps)
 );
(In reply to Marcos Caceres [:marcosc] from comment #17)
> Nit, why not just: 
> 
>  return this._getRequisition().then(
>    requisition => requisition.system.commands.getCommandSpecs(customProps)
>  );

I saw this notation was deprecated somewhere on MDN.
(In reply to Marcos Caceres [:marcosc] from comment #17)
> Nit, why not just: 
> 
>  return this._getRequisition().then(
>    requisition => requisition.system.commands.getCommandSpecs(customProps)
>  );

Just to remove the return?  That's fine too, but also seems like an uber style nit to me. :) Either way, the patch I've attached is still needed.
(In reply to Tim Nguyen [:ntim] from comment #18)
> (In reply to Marcos Caceres [:marcosc] from comment #17)
> > Nit, why not just: 
> > 
> >  return this._getRequisition().then(
> >    requisition => requisition.system.commands.getCommandSpecs(customProps)
> >  );
> 
> I saw this notation was deprecated somewhere on MDN.

Ah, it's just for the classic function notation : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Expression_closures

Works for arrow functions.
https://hg.mozilla.org/integration/fx-team/rev/fd84063e1296
Keywords: checkin-needed
Whiteboard: [devedition-40][difficulty=easy] → [devedition-40][difficulty=easy][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/fd84063e1296
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [devedition-40][difficulty=easy][fixed-in-fx-team] → [devedition-40][difficulty=easy]
Target Milestone: --- → Firefox 40
(In reply to J. Ryan Stinnett [:jryans] (use ni?) from comment #19)
> (In reply to Marcos Caceres [:marcosc] from comment #17)
> > Nit, why not just: 
> > 
> >  return this._getRequisition().then(
> >    requisition => requisition.system.commands.getCommandSpecs(customProps)
> >  );
> 
> Just to remove the return?  That's fine too, but also seems like an uber
> style nit to me. :) Either way, the patch I've attached is still needed.

FWIW, the style guide in my head says that the (x => y) format is for one liners, and I do

    (x => {
      return y;
    })

When it goes onto more than one line. But I'm not fussy about it.
As an aside, we should really get our (Moz) act together and adopt a machine-processable style guide. The amount of variation from one team to another wrt JS code makes things really hard to work with and review. 

I wonder where we can have this conversation?
jryans, when should I see this fix in nightly? I still don't see my inspect button in the latest nightly.

40.0a1 (2015-04-30)
Flags: needinfo?(jryans)
(In reply to Michael Henretty [:mhenretty] from comment #25)
> jryans, when should I see this fix in nightly? I still don't see my inspect
> button in the latest nightly.
> 
> 40.0a1 (2015-04-30)

I double checked and I do see the button showing up in Browser Toolbox but am still seeing the issue in WebIDE with the following error:

"Protocol error (unrecognizedPacketType): Actor server1.conn0.child8/gcliActor11 does not recognize the packet type specs" protocol.js:20
onPacket threw an exception: Error: Server did not specify an actor, dropping packet: {"error":"unknownError","message":"Error occurred while creating actor 'undefined: TypeError: browser is undefined\nStack: exports.GcliActor<.initialize@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/gcli.js:1:952\nconstructor@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/core/heritage.js:16:80\nObservedActorFactory.prototype.createActor@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/common.js:13:99\nDebuggerServerConnection.prototype._getOrCreateActor@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/main.js:83:53\nDSC_onPacket@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/main.js:93:11\nChildDebuggerTransport.prototype.receiveMessage@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/transport/transport.js:38:337\nLine: 1, column: 951"}
Stack: DebuggerClient.prototype.onPacket@resource://gre/modules/devtools/dbg-client.jsm:944:1
DebuggerTransport.prototype._onJSONObjectReady/<@resource://gre/modules/devtools/dbg-client.jsm -> resource://gre/modules/devtools/transport/transport.js:471:9
makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/DevToolsUtils.js:82:14
makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/DevToolsUtils.js:82:14
Line: 944, column: 0 DevToolsUtils.js:58:0
"Protocol error (unrecognizedPacketType): Actor server1.conn0.child8/gcliActor11 does not recognize the packet type specs" Promise-backend.js:870
(In reply to Michael Henretty [:mhenretty] from comment #25)
> jryans, when should I see this fix in nightly? I still don't see my inspect
> button in the latest nightly.
> 
> 40.0a1 (2015-04-30)

It seems there are still unsolved issues remaining for both old servers of any kind (bug 1160345) and new non-Firefox servers (bug 1160361), unfortunately.

Follow those for the remaining work.
Flags: needinfo?(jryans)
Whiteboard: [devedition-40][difficulty=easy] → [polish-backlog][difficulty=easy]
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: