@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
|
-
|
|
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)))
|