New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: route frame based permission checks through our permission check handler #19903
Conversation
This is tagged as |
Could we perhaps make this not a breaking change by having a default implementation of i.e.
Does Chromium ever call the check before the request..? Another way to handle this API would be something like:
|
@nornagon This isn't a breaking change because of that. The only reason this is marked as |
I'm pretty sure requiring a new permission handler for e.g. web notifications or fullscreen is also a breaking change. |
@nornagon it doesn't require a new permission handler, the handler defaults to granted so it's not a breaking change |
2c2bfb3
to
215d00a
Compare
@nornagon @MarshallOfSound Hi there, what is the status of this PR? When it can be ready? Also will it be available in electron 8 and 9? Thank you. |
@nikitakot as you can see from the comments in this PR:
We do not merge breaking changes to old branches. The soonest this could possibly be available is Electron 12, as Electron 11 is a quiet release. |
215d00a
to
f532bd4
Compare
f532bd4
to
e00bb8e
Compare
Release Notes Persisted
|
@MarshallOfSound This PR (commit 771e34a) introduced an undocumented To reproduce: const { app, BrowserWindow } = require('electron')
app.whenReady().then(() => {
const win = new BrowserWindow({ width: 800, height: 600 })
const ses = win.webContents.session
console.log(ses.getUserAgent())
ses.setPermissionRequestHandler((...args) => console.log('request', args))
ses.setPermissionCheckHandler((...args) => console.log('check', args))
win.loadURL('about:blank')
}) To trigger the event do any screen configuration changes: e.g. connect or disconnect an external display, or change screen rotation or resolution, or just turn the monitor off and on again. Even that might not be needed, for some setups this just happens on launch apparently. This still happens even if |
Bringing back #14544
Fixes #14544
Notes: Additional permission checks are now routed through
session.setPermissionCheckHandler
. These includeNotification.permission
, andpermission.query
. Please note that thewebContents
parameter to the check handler can now be null.