зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1275078 - toolbox-init.js error handling tweaks from Positron. r=ochameau
MozReview-Commit-ID: LDjzdUTJikc --HG-- extra : rebase_source : 7e6c96f9543f14f07c00ee79d9a3796292c7d04f
This commit is contained in:
Родитель
9896e105b8
Коммит
ffd700eb00
|
@ -58,12 +58,15 @@ if (url.search.length > 1) {
|
|||
// `iframe` is the targeted document to debug
|
||||
let iframe = host.wrappedJSObject ? host.wrappedJSObject.target
|
||||
: host.target;
|
||||
if (!iframe) {
|
||||
throw new Error("Unable to find the targeted iframe to debug");
|
||||
}
|
||||
|
||||
// Need to use a xray and query some interfaces to have
|
||||
// attributes and behavior expected by devtools codebase
|
||||
iframe = XPCNativeWrapper(iframe);
|
||||
iframe.QueryInterface(Ci.nsIFrameLoaderOwner);
|
||||
|
||||
if (iframe) {
|
||||
// Fake a xul:tab object as we don't have one.
|
||||
// linkedBrowser is the only one attribute being queried by client.getTab
|
||||
let tab = { linkedBrowser: iframe };
|
||||
|
@ -79,9 +82,6 @@ if (url.search.length > 1) {
|
|||
let response = yield client.getTab({ tab });
|
||||
let form = response.tab;
|
||||
target = yield TargetFactory.forRemoteTab({client, form, chrome: false});
|
||||
} else {
|
||||
alert("Unable to find the targetted iframe to debug");
|
||||
}
|
||||
} else {
|
||||
target = yield targetFromURL(url);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче