Skip to content

Commit

Permalink
Meta tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Aug 30, 2019
1 parent 79868f1 commit d9fd3ad
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions index.js
Expand Up @@ -216,11 +216,13 @@ const create = (win, options) => {
const menu = (electron.remote ? electron.remote.Menu : electron.Menu).buildFromTemplate(menuTemplate);

/*
When `electron.remote`` is not available this runs in the browser process.
We can safely use `win`` in this case as it refers to the window the
When `electron.remote` is not available, this runs in the browser process.
We can safely use `win` in this case as it refers to the window the
context-menu should open in.
When this is being called from a webView, we can't use win as this
would refere to the webView which is not allowed to render a popup menu.
When this is being called from a web view, we can't use `win` as this
would refer to the web view which is not allowed to render a popup menu.
*/
menu.popup(electron.remote ? electron.remote.getCurrentWindow() : win);
}
Expand Down Expand Up @@ -250,6 +252,3 @@ module.exports = (options = {}) => {
create(win, options);
});
};

// TODO: Remove this for the next major release
module.exports.default = module.exports;

0 comments on commit d9fd3ad

Please sign in to comment.