Skip to content

Commit

Permalink
[MM-55261] Allow embedded video links to go fullscreen after a permis…
Browse files Browse the repository at this point in the history
…sion check (#2905)
  • Loading branch information
devinbinnie authored Nov 10, 2023
1 parent 7aed1eb commit a107127
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/permissionsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,17 @@ export class PermissionsManager extends JsonFileManager<Permissions> {
return false;
}

// Exception for embedded videos such as YouTube
// We still want to ask permission to do this though
const isExternalFullscreen = permission === 'fullscreen' && parsedURL.origin !== serverURL.origin;

// is the requesting url trusted?
if (!(isTrustedURL(parsedURL, serverURL) || (permission === 'media' && parsedURL.origin === serverURL.origin))) {
if (!(isTrustedURL(parsedURL, serverURL) || (permission === 'media' && parsedURL.origin === serverURL.origin) || isExternalFullscreen)) {
return false;
}

// For certain permission types, we need to confirm with the user
if (authorizablePermissionTypes.includes(permission)) {
if (authorizablePermissionTypes.includes(permission) || isExternalFullscreen) {
const currentPermission = this.json[parsedURL.origin]?.[permission];

// If previously allowed, just allow
Expand Down

0 comments on commit a107127

Please sign in to comment.