/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Via webext-panels.xhtml /* import-globals-from browser.js */ /* global windowRoot */
if (gAllowTransparentBrowser) {
browser.setAttribute("transparent", "true");
}
// Ensure that the browser is going to run in the same bc group as the other // extension pages from the same addon.
browser.setAttribute( "initialBrowsingContextGroupId",
panel.extension.policy.browsingContextGroupId
);
let readyPromise; if (panel.extension.remote) {
browser.setAttribute("remote", "true");
let oa = E10SUtils.predictOriginAttributes({ browser });
browser.setAttribute( "remoteType",
E10SUtils.getRemoteTypeForURI(
panel.uri, /* remote */ true, /* fission */ false,
E10SUtils.EXTENSION_REMOTE_TYPE, null,
oa
)
);
browser.setAttribute("maychangeremoteness", "true");
// Stub tabbrowser implementation to make sure that links from inside // extension sidebar panels open in new tabs, see bug 1488055. var gBrowser = {
get selectedBrowser() { return document.getElementById("webext-panels-browser");
},
getTabForBrowser() { returnnull;
},
};
function updatePosition() { // We need both of these to make sure we update the position // after any lower level updates have finished.
requestAnimationFrame(() =>
setTimeout(() => {
let browser = document.getElementById("webext-panels-browser"); if (browser && browser.isRemoteBrowser) {
browser.frameLoader.requestUpdatePosition();
}
}, 0)
);
}
function loadPanel(extensionId, extensionUrl, browserStyle) {
let browserEl = document.getElementById("webext-panels-browser"); if (browserEl) { if (browserEl.currentURI.spec === extensionUrl) { return;
} // Forces runtime disconnect. Remove the stack (parent).
browserEl.parentNode.remove();
}
let policy = WebExtensionPolicy.getByID(extensionId);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.