devtools-modules
Advanced tools
Comparing version 0.0.39 to 0.0.40
{ | ||
"name": "devtools-modules", | ||
"version": "0.0.39", | ||
"version": "0.0.40", | ||
"description": "DevTools Modules from M-C", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,6 +5,12 @@ /* This Source Code Form is subject to the terms of the Mozilla Public | ||
const { formatKeyShortcut } = require("../utils/text"); | ||
const EventEmitter = require("../utils/event-emitter"); | ||
function inToolbox() { | ||
return !window || window.parent.document.documentURI == "about:devtools-toolbox"; | ||
try { | ||
return window.parent.document.documentURI == "about:devtools-toolbox"; | ||
} catch (e) { | ||
// If `window` is not available, it's very likely that we are in the toolbox. | ||
return true; | ||
} | ||
} | ||
@@ -137,2 +143,5 @@ | ||
} | ||
if (item.accelerator) { | ||
menuitem.setAttribute("acceltext", formatKeyShortcut(item.accelerator)); | ||
} | ||
parent.appendChild(menu); | ||
@@ -170,3 +179,5 @@ } else if (item.type === "separator") { | ||
} | ||
if (item.accelerator) { | ||
menuitem.setAttribute("acceltext", formatKeyShortcut(item.accelerator)); | ||
} | ||
parent.appendChild(menuitem); | ||
@@ -173,0 +184,0 @@ } |
@@ -15,3 +15,2 @@ /* This Source Code Form is subject to the terms of the Mozilla Public | ||
* - sublabel String | ||
* - accelerator Accelerator | ||
* - icon NativeImage | ||
@@ -39,2 +38,4 @@ * - position String - This field allows fine-grained definition of the | ||
* If false, the menu item will be entirely hidden. | ||
* String accelerator | ||
* If specified, will be used as accelerator text for MenuItem | ||
*/ | ||
@@ -51,2 +52,3 @@ function MenuItem({ | ||
visible = true, | ||
accelerator = "", | ||
} = { }) { | ||
@@ -62,4 +64,5 @@ this.accesskey = accesskey; | ||
this.visible = visible; | ||
this.accelerator = accelerator; | ||
} | ||
module.exports = MenuItem; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
120936
25
3020