Bug 1037374 - Uplift Add-on SDK to Firefox r=me

This commit is contained in:
Erik Vold
2014-07-15 06:19:40 -07:00
parent 27f79cc0c0
commit 664e06b87f
19 changed files with 298 additions and 53 deletions

View File

@@ -211,7 +211,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);
@@ -404,3 +404,13 @@ exports.getContentDocument = getContentDocument;
function setURL(panel, url) getContentFrame(panel).setAttribute("src", url)
exports.setURL = setURL;
function allowContextMenu(panel, allow) {
if(allow) {
panel.setAttribute("context", "contentAreaContextMenu");
}
else {
panel.removeAttribute("context");
}
}
exports.allowContextMenu = allowContextMenu;