Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions app/renderer/js/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -961,20 +961,22 @@ export class ServerManagerView {
permissionCallbackId: number,
) => {
const grant =
webContentsId === null
? origin === "null" && permission === "notifications"
: (
await Promise.all(
this.tabs.map(async (tab) => {
if (!(tab instanceof ServerTab)) return false;
const webview = await tab.webview;
return (
webview.webContentsId === webContentsId &&
webview.properties.hasPermission?.(origin, permission)
);
}),
)
).some(Boolean);
permission === "fullscreen"
? true
: webContentsId === null
? origin === "null" && permission === "notifications"
: (
await Promise.all(
this.tabs.map(async (tab) => {
if (!(tab instanceof ServerTab)) return false;
const webview = await tab.webview;
return (
webview.webContentsId === webContentsId &&
webview.properties.hasPermission?.(origin, permission)
);
}),
)
).some(Boolean);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I don't like how hasPermission works currently. Changes should be made in hasPermission instead and not here.

console.log(
grant ? "Granted" : "Denied",
"permissions request for",
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.