Skip to content

Commit e17c5c8

Browse files
committed
v0.1.2
1 parent 6577201 commit e17c5c8

File tree

5 files changed

+44
-2
lines changed

5 files changed

+44
-2
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"keywords": [
55
"Vue.js", "Electron", "TypeScript", "JavaScript", "boilerplate", "quickstart", "template"
66
],
7-
"version": "0.1.1",
7+
"version": "0.1.2",
88
"private": false,
99
"scripts": {
1010
"start": "electron .",

src.mainproc/windows/MainWindow.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,20 @@ export function createMainWindow() {
4242
});
4343
});
4444

45+
mainWindow.webContents.session.setPermissionRequestHandler((webContents, permission, callback) => {
46+
// const url = webContents.getURL();
47+
//
48+
// if (permission === 'notifications') {
49+
// // Approves the permissions request
50+
// callback(true);
51+
// }
52+
// if (!url.startsWith('https://my-website.com')) {
53+
// // Denies the permissions request
54+
// return callback(false);
55+
// }
56+
return callback(false);
57+
});
58+
4559
// Open the DevTools.
4660
// mainWindow.webContents.openDevTools()
4761

src.mainproc/windows/SubWindow.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@ export function createSubWindow() {
3434
});
3535
});
3636

37+
subWindow.webContents.session.setPermissionRequestHandler((webContents, permission, callback) => {
38+
// const url = webContents.getURL();
39+
//
40+
// if (permission === 'notifications') {
41+
// // Approves the permissions request
42+
// callback(true);
43+
// }
44+
// if (!url.startsWith('https://my-website.com')) {
45+
// // Denies the permissions request
46+
// return callback(false);
47+
// }
48+
return callback(false);
49+
});
50+
3751
// Open the DevTools.
3852
// subWindow.webContents.openDevTools()
3953

src.mainproc/windows/UserContentWindow.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,20 @@ export function createUserContentWindow() {
4242
});
4343
});
4444

45+
userContentWindow.webContents.session.setPermissionRequestHandler((webContents, permission, callback) => {
46+
// const url = webContents.getURL();
47+
//
48+
// if (permission === 'notifications') {
49+
// // Approves the permissions request
50+
// callback(true);
51+
// }
52+
// if (!url.startsWith('https://my-website.com')) {
53+
// // Denies the permissions request
54+
// return callback(false);
55+
// }
56+
return callback(false);
57+
});
58+
4559
// Open the DevTools.
4660
// userContentWindow.webContents.openDevTools()
4761

0 commit comments

Comments
 (0)