Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

devtools-modules

Package Overview
Dependencies
Maintainers
12
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

devtools-modules - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

2

package.json
{
"name": "devtools-modules",
"version": "1.1.1",
"version": "1.1.2",
"description": "DevTools Modules from M-C",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -47,2 +47,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public

// Copied from m-c DevToolsUtils.
function getTopWindow(win) {
return win.windowRoot ? win.windowRoot.ownerGlobal : win.top;
}
/**

@@ -99,7 +104,12 @@ * A partial implementation of the Menu API provided by electron:

* @param {int} screenY
* @param Toolbox toolbox (non standard)
* Needed so we in which window to inject XUL
* @param {Document} doc
* The document that should own the context menu.
*/
Menu.prototype.popup = function (screenX, screenY, toolbox) {
let doc = toolbox.doc;
Menu.prototype.popup = function (screenX, screenY, doc) {
// The context-menu will be created in the topmost window to preserve keyboard
// navigation. See Bug 1543940. Keep a reference on the window owning the menu to hide
// the popup on unload.
const win = doc.defaultView;
doc = getTopWindow(doc.defaultView).document;
let popupset = doc.querySelector("popupset");

@@ -127,5 +137,11 @@ if (!popupset) {

// The context menu will be created in the topmost chrome window. Hide it manually when
// the owner document is unloaded.
const onWindowUnload = () => popup.hidePopup();
win.addEventListener("unload", onWindowUnload);
// Remove the menu from the DOM once it's hidden.
popup.addEventListener("popuphidden", (e) => {
if (e.target === popup) {
win.removeEventListener("unload", onWindowUnload);
popup.remove();

@@ -132,0 +148,0 @@ this.emit("close", popup);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc