fix: emit context-menu
event in Windows draggable regions (#45851)
fix: emit context-menu event in Windows draggable regions
This commit is contained in:
parent
785fe5f3b6
commit
7c0b7b417b
3 changed files with 29 additions and 5 deletions
|
@ -2896,8 +2896,13 @@ describe('webContents module', () => {
|
|||
expect(contextMenuEmitCount).to.equal(1);
|
||||
});
|
||||
|
||||
ifit(process.platform !== 'win32')('emits when right-clicked in page in a draggable region', async () => {
|
||||
it('emits when right-clicked in page in a draggable region', async () => {
|
||||
const w = new BrowserWindow({ show: false });
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
w.on('system-context-menu', (event) => { event.preventDefault(); });
|
||||
}
|
||||
|
||||
await w.loadFile(path.join(fixturesPath, 'pages', 'draggable-page.html'));
|
||||
|
||||
const promise = once(w.webContents, 'context-menu') as Promise<[any, Electron.ContextMenuParams]>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue