Keyboard shortcuts to open devtools don't work
Categories
(DevTools :: Framework, defect, P2)
Tracking
(Not tracked)
People
(Reporter: nchevobbe, Unassigned)
Details
Steps to reproduce
- Hit Cmd + Alt + I to open DevTools
Expected results
DevTools open
Actual results
Nothing happens, and I see the following message in the browser console:
Exception while trigerring key [object Object]: Protocol error (noTab): Unable to find tab with tabId '1'
undefined 3 DevToolsStartup.jsm:609:15
onKey resource:///modules/DevToolsStartup.jsm:609
Error originates from devtools/startup/DevToolsStartup.jsm#609
| Reporter | ||
Comment 1•7 years ago
|
||
I'm running mozregression to check where the regression comes from
| Reporter | ||
Updated•7 years ago
|
| Reporter | ||
Comment 2•7 years ago
|
||
and now I can't reproduce anymore 🤔
| Reporter | ||
Updated•7 years ago
|
| Reporter | ||
Comment 3•7 years ago
|
||
So this happened to me today again.
I don't have the root cause, but I spotted a possible issue.
In TargetFactory.forTab(devtools/client/framework/target.js#18-43), we have a cache of the targets:
forTab: async function(tab) {
let target = targets.get(tab);
if (target) {
return target;
}
const promise = this.createTargetForTab(tab);
// Immediately set the target's promise in cache to prevent race
targets.set(tab, promise);
target = await promise;
// Then replace the promise with the target object
targets.set(tab, target);
target.attachTab(tab);
target.once("close", () => {
targets.delete(tab);
});
return target;
}
So here, if promise, created by createTargetForTab rejects (which seems to happen in devtools/client/framework/target.js#87, which calls BrowserTabList.prototype.getTab and can return a rejected promise if the tab isn't found devtools/server/actors/webbrowser.js#354-357), forTab will always return the rejected promise.
So, the broader fix would be to fix the race which makes us not find the tab first (but I agree it could be hard). A secondary fix would be to remove the promise from targets in forTab if the promise rejects. Because then we'll reach for BrowserTabList.prototype.getTab, and this time we might be ready (I tested this while paused in forTab, and I was then able to open the webconsole).
Alex, would you have an idea on the root cause (not finding the tab)?
| Reporter | ||
Updated•6 years ago
|
Comment 4•6 years ago
|
||
Downgrading to P2 since we haven't had other reports of this issue (to my knowledge) and no one is actively working on this issue.
Comment 5•6 years ago
|
||
This code changed quite a bit and may have been fixed?
Comment 6•4 years ago
|
||
Ctrl + Shift + I works for me on Windows
Option + Cmd + I works for me on Mac
Nicolas, time to close this one?
| Reporter | ||
Comment 7•4 years ago
|
||
yeah, let's close as INCOMPLETE as we couldn't reproduce easily and the code changed a lot anyway
Description
•