feat: add --enable-api-filtering-logging commandline switch (#20335)
This commit is contained in:
parent
e1eb9519f5
commit
ccff140046
15 changed files with 85 additions and 29 deletions
|
@ -23,6 +23,12 @@ const emitCustomEvent = function (contents, eventName, ...args) {
|
|||
return event
|
||||
}
|
||||
|
||||
const logStack = function (contents, code, stack) {
|
||||
if (stack) {
|
||||
console.warn(`WebContents (${contents.id}): ${code}`, stack)
|
||||
}
|
||||
}
|
||||
|
||||
// Implements window.close()
|
||||
ipcMainInternal.on('ELECTRON_BROWSER_WINDOW_CLOSE', function (event) {
|
||||
const window = event.sender.getOwnerBrowserWindow()
|
||||
|
@ -63,7 +69,8 @@ ipcMainUtils.handleSync('ELECTRON_BROWSER_CLIPBOARD', function (event, method, .
|
|||
if (features.isDesktopCapturerEnabled()) {
|
||||
const desktopCapturer = require('@electron/internal/browser/desktop-capturer')
|
||||
|
||||
ipcMainInternal.handle('ELECTRON_BROWSER_DESKTOP_CAPTURER_GET_SOURCES', function (event, ...args) {
|
||||
ipcMainInternal.handle('ELECTRON_BROWSER_DESKTOP_CAPTURER_GET_SOURCES', function (event, options, stack) {
|
||||
logStack(event.sender, 'desktopCapturer.getSources()', stack)
|
||||
const customEvent = emitCustomEvent(event.sender, 'desktop-capturer-get-sources')
|
||||
|
||||
if (customEvent.defaultPrevented) {
|
||||
|
@ -71,7 +78,7 @@ if (features.isDesktopCapturerEnabled()) {
|
|||
return []
|
||||
}
|
||||
|
||||
return desktopCapturer.getSources(event, ...args)
|
||||
return desktopCapturer.getSources(event, options)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue