Bug 1114752 - Uplift Add-on SDK to Firefox a=me

This commit is contained in:
Erik Vold
2015-02-03 09:51:16 -08:00
parent 26486d7255
commit bd05d2922a
349 changed files with 16843 additions and 4402 deletions

View File

@@ -213,7 +213,7 @@ function show(panel, options, anchor) {
// Prevent the panel from getting focus when showing up
// if focus is set to false
panel.setAttribute("noautofocus", !options.focus);
let window = anchor && getOwnerBrowserWindow(anchor);
let { document } = window ? window : getMostRecentBrowserWindow();
attach(panel, document);
@@ -286,8 +286,7 @@ function make(document) {
events.emit(type, { subject: panel });
}
function onContentChange({subject, type}) {
let document = subject;
function onContentChange({subject: document, type}) {
if (document === getContentDocument(panel) && document.defaultView)
events.emit(type, { subject: panel });
}
@@ -411,9 +410,9 @@ function setURL(panel, url) {
exports.setURL = setURL;
function allowContextMenu(panel, allow) {
if(allow) {
if (allow) {
panel.setAttribute("context", "contentAreaContextMenu");
}
}
else {
panel.removeAttribute("context");
}