@pmate/cli 0.49.4 → 0.49.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,7 +12,11 @@ function installMediaPermissions(desktopSession, { origin, getWindow, getWindows
12
12
  }
13
13
  desktopSession.setPermissionRequestHandler((contents, permission, callback, details) => {
14
14
  const allowed = trusted(contents) && details.isMainFrame === true && sameOrigin(details.requestingUrl)
15
- callback(Boolean((allowed && permission === 'display-capture') || (permission === 'media' && audioAllowed(contents, details.requestingUrl, details) && details.mediaTypes?.length && details.mediaTypes.every(type => type === 'audio'))))
15
+ // Electron 44 also reports getDisplayMedia as legacy `media` with no device
16
+ // types. This only admits the request to the display handler below, which
17
+ // still checks the exact frame, origin, user gesture and explicit selection.
18
+ const legacyDisplay = permission === 'media' && Array.isArray(details.mediaTypes) && details.mediaTypes.length === 0
19
+ callback(Boolean((allowed && (permission === 'display-capture' || legacyDisplay)) || (permission === 'media' && audioAllowed(contents, details.requestingUrl, details) && details.mediaTypes?.length && details.mediaTypes.every(type => type === 'audio'))))
16
20
  })
17
21
  desktopSession.setPermissionCheckHandler((contents, permission, requestingOrigin, details) => {
18
22
  return Boolean((trusted(contents) && sameOrigin(requestingOrigin) && details.isMainFrame === true && permission === 'display-capture') || (permission === 'media' && details.mediaType === 'audio' && audioAllowed(contents, requestingOrigin, details)))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pmate/cli",
3
- "version": "0.49.4",
3
+ "version": "0.49.5",
4
4
  "description": "CLI utilities for the pMate project",
5
5
  "license": "MIT",
6
6
  "bin": {