Skip to content

Commit ea9817f

Browse files
committed
r0b08x [chore] 7/20/2023, 11:37:01 AM
1 parent b7ee91b commit ea9817f

File tree

13 files changed

+95
-101
lines changed

13 files changed

+95
-101
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
@license p3x-onenote v2023.10.214
2+
@license p3x-onenote v2023.10.220
33

44
📚 P3X OneNote Linux
55

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313

14-
# 📚 P3X OneNote Linux v2023.10.215
14+
# 📚 P3X OneNote Linux v2023.10.220
1515

1616

1717

@@ -240,7 +240,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://
240240

241241
---
242242

243-
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.215
243+
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.220
244244

245245
[![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
246246

artifacts/arm.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://
2525

2626
---
2727

28-
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.215
28+
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.220
2929

3030
[![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
3131

artifacts/flavor.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://
2424

2525
---
2626

27-
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.215
27+
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.220
2828

2929
[![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
3030

artifacts/new-language.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://
2525

2626
---
2727

28-
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.215
28+
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.220
2929

3030
[![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
3131

artifacts/npm.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://
3838

3939
---
4040

41-
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.215
41+
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.220
4242

4343
[![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
4444

change-log.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
## Change log
99

10+
### v2023.10.220
11+
Relesed on 07/20/2023
12+
* CHORE: Updated Electron
13+
1014
### v2023.10.205
1115
Released on 07/19/2022
1216
* TEST: Auto upload with deb and AppImage
@@ -370,7 +374,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://
370374

371375
---
372376

373-
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.215
377+
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.220
374378

375379
[![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
376380

package.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "p3x-onenote",
3-
"version": "2023.10.216",
3+
"version": "2023.10.220",
44
"description": "📚 P3X OneNote Linux",
55
"main": "src/electron/app.js",
66
"corifeus": {
@@ -28,6 +28,7 @@
2828
"postinstall-save": "opencollective postinstall",
2929
"start": "node ./node_modules/.bin/electron ./src/electron/app.js",
3030
"publish-electron": "rm -rf dist && electron-builder --p onTagOrDraft --linux --armv7l --arm64 --linux AppImage deb rpm --x64",
31+
"publish-electron-deb": "rm -rf dist && electron-builder --p onTagOrDraft --linux --armv7l --arm64 --linux deb --x64",
3132
"publish-electron-test": "rm -rf dist && electron-builder --p onTagOrDraft --linux --linux AppImage deb --x64",
3233
"publish-electron-snap": "rm -rf dist && electron-builder --linux snap -p never",
3334
"publish-electron-yml": "node ./node_modules/corifeus-builder/src/utils/appimage/post-build.js"
@@ -59,7 +60,7 @@
5960
"electron-store": "^8.1.0",
6061
"electron-updater": "^6.1.2",
6162
"semver": "^7.5.4",
62-
"electron": "^25.3.0"
63+
"electron": "^25.3.1"
6364
},
6465
"devDependencies": {
6566
"corifeus-builder": "^2023.10.128",
@@ -69,14 +70,12 @@
6970
"node": ">=12.13.0"
7071
},
7172
"build": {
72-
"generateUpdatesFilesForAllChannels": true,
7373
"afterAllArtifactBuild": "./node_modules/corifeus-builder/src/utils/appimage/after-all-artifact-build.js",
7474
"publish": [
7575
{
7676
"provider": "github",
7777
"owner": "patrikx3",
78-
"repo": "onenote",
79-
"channel": "latest"
78+
"repo": "onenote"
8079
}
8180
],
8281
"appId": "p3x.onenote",

scripts/start-local.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env bash
22
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
3-
./node_modules/.bin/electron --no-sandbox $DIR/.. $@
3+
./node_modules/.bin/electron $DIR/.. $@

src/electron/main/create/window/onenote.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,16 @@ function createWindow() {
2222
});
2323
global.p3x.onenote.window.onenote.loadURL(`file://${__dirname}/../../../window/onenote/index.html`);
2424

25-
remoteMain.enable(global.p3x.onenote.window.onenote.webContents)
25+
global.p3x.onenote.window.onenote.webContents.on("did-attach-webview", (_, contents) => {
26+
contents.setWindowOpenHandler((details) => {
27+
global.p3x.onenote.window.onenote.webContents.send('p3x-onenote-new-window', details);
28+
return { action: 'deny' }
29+
})
30+
})
2631

32+
remoteMain.enable(global.p3x.onenote.window.onenote.webContents)
2733

34+
2835
if (process.env.NODE_ENV === 'debug') {
2936
global.p3x.onenote.window.onenote.openDevTools()
3037
}
@@ -117,7 +124,6 @@ function createWindow() {
117124

118125

119126
const {autoUpdater} = require("electron-updater");
120-
autoUpdater.channel = "latest"
121127

122128
autoUpdater.on('checking-for-update', (info) => {
123129
console.log('checking-for-update', info)

src/electron/window/onenote/event/handler.js

+52-69
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,12 @@ const handler = (options) => {
1717

1818
//const disalledUrl = /^((https?:\/\/))/i
1919

20+
/*
2021
let windowInterval
21-
2222
const generateInterval = () => {
23-
windowInterval = setInterval(() => {
24-
//console.log(webview.src, global.p3x.onenote.root.p3x.onenote.location)
25-
26-
/*
27-
ipc.send('p3x-debug', {
28-
'new-window': webview.src,
29-
allowed: allowedUrlRegex.test(webview.src)
30-
})
31-
*/
32-
33-
/*
34-
if (!allowedUrlRegex.test(webview.src)) {
35-
p3x.onenote.ui.overlay.show({
36-
message: p3x.onenote.lang.label.disallowedContent
37-
})
38-
} else {
39-
p3x.onenote.ui.overlay.hide()
40-
}
41-
*/
42-
43-
23+
windowInterval = setInterval(() => {
4424
if (global.p3x.onenote.root && global.p3x.onenote.root.p3x.onenote.location !== webview.src) {
25+
console.log('changed the url via interval', webview.src)
4526
p3x.onenote.wait.angular(() => {
4627
global.p3x.onenote.root.p3x.onenote.location = webview.src
4728
global.p3x.onenote.data.url = webview.src
@@ -61,6 +42,7 @@ const handler = (options) => {
6142
generateInterval()
6243
}
6344
})
45+
*/
6446

6547
/*
6648
webview.addEventListener('did-stop-loading', function(event) {
@@ -82,25 +64,34 @@ const handler = (options) => {
8264
});
8365
*/
8466

85-
webview.addEventListener('did-navigate', function (event, url) {
86-
/*
87-
ipc.send('p3x-debug', {
88-
'did-navigate': event,
89-
url: url,
67+
for(let eventName of ['did-navigate', 'did-navigate-in-page']) {
68+
webview.addEventListener(eventName, function (event, url) {
69+
/*
70+
ipc.send('p3x-debug', {
71+
'did-navigate': event,
72+
url: url,
73+
});
74+
*/
75+
console.log(`changed the url via ${eventName}`, webview.src)
76+
77+
global.p3x.onenote.data.url = webview.src;
78+
ipc.send('p3x-onenote-save', global.p3x.onenote.data);
79+
80+
p3x.onenote.wait.angular(() => {
81+
global.p3x.onenote.root.p3x.onenote.location = webview.src
82+
global.p3x.onenote.root.$digest()
83+
})
84+
9085
});
91-
*/
86+
87+
88+
}
9289

93-
global.p3x.onenote.data.url = webview.src;
94-
ipc.send('p3x-onenote-save', global.p3x.onenote.data);
90+
9591

96-
p3x.onenote.wait.angular(() => {
97-
global.p3x.onenote.root.p3x.onenote.location = webview.src
98-
global.p3x.onenote.root.$digest()
99-
})
10092

101-
});
10293

103-
webview.addEventListener("dom-ready", event => {
94+
webview.addEventListener('dom-ready', event => {
10495
//TODO Remove this once https://github.com/electron/electron/issues/14474 is fixed
10596
webview.blur();
10697
webview.focus();
@@ -114,8 +105,11 @@ const handler = (options) => {
114105

115106
});
116107

108+
/*
117109
webview.addEventListener('new-window', function (event) {
118110
111+
console.log('new-window', event.url)
112+
119113
event.preventDefault()
120114
//p3x.onenote.toast.action(p3x.onenote.lang.label.unknownLink)
121115
@@ -134,41 +128,30 @@ const handler = (options) => {
134128
}
135129
})
136130
}
137-
138-
//;
139-
140-
/*
141-
ipc.send('p3x-debug', {
142-
'new-window': event.url,
143-
allowed: allowedUrlRegex.test(event.url)
144-
})
145-
*/
146-
147-
//console.log(event.url)
148-
/*
149-
if (allowedUrlRegex2.test(event.url)) {
150-
// https://onedrive.live.com/redir?resid=3B992A1F2BEDFFA7%21955&page=Edit
151-
const urlParts = event.url.match(allowedUrlRegex2)
152-
/*
153-
ipc.send('p3x-debug', {
154-
urlParts: urlParts
155-
})
156-
*/
157-
/*
158-
p3x.onenote.toast.action(p3x.onenote.lang.redirecting)
159-
webview.src = `https://onedrive.live.com/redir?resid=${urlParts[1]}%21955&page=Edit`;
160-
} else
161-
*/
162-
/*
163-
if (allowedUrlRegex.test(event.url) || allowedUrlRegex2.test(event.url)) {
164-
p3x.onenote.toast.action(p3x.onenote.lang.redirecting)
165-
webview.src = event.url;
166-
} else {
167-
shell.openExternal(event.url);
168-
}
169-
*/
170131
});
132+
*/
171133

134+
/*
135+
for(let event of [
136+
'did-finish-load',
137+
'did-frame-finish-load',
138+
'did-start-loading',
139+
'page-title-updated',
140+
'will-navigate',
141+
'did-start-navigation',
142+
'did-redirect-navigation',
143+
'did-navigate',
144+
'did-frame-navigate',
145+
'did-navigate-in-page',
146+
'update-target-url',
147+
]) {
148+
webview.addEventListener(event, function(eventData) {
149+
if (eventData.url) {
150+
console.log(event, event.url)
151+
}
152+
})
153+
}
154+
*/
172155

173156
}
174157

src/electron/window/onenote/ipc/handler.js

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const {ipcRenderer} = require('electron');
1+
const {shell, ipcRenderer} = require('electron');
22

33
const setProxy = require('../action/set-proxy');
44
const multiActions = require('../action/multi-actions');
@@ -101,7 +101,23 @@ const handler = (options) => {
101101
})
102102

103103

104-
104+
ipcRenderer.on('p3x-onenote-new-window', (event, data) => {
105+
if (data.url.trim().startsWith('about:blank')) {
106+
//webview.src = event.url;
107+
return
108+
}
109+
if (global.p3x.onenote.conf.get('option-to-disable-internal-external-popup') === true) {
110+
webview.src = event.url
111+
} else {
112+
global.p3x.onenote.prompt.redirect({url: data.url}).then((answer) => {
113+
if (answer === 'internal') {
114+
webview.src = data.url;
115+
} else {
116+
shell.openExternal(data.url)
117+
}
118+
})
119+
}
120+
})
105121

106122
}
107123

src/electron/window/onenote/load.js

-14
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
11
const {ipcRenderer} = require('electron');
22

3-
/*
4-
const fs = require('fs')
5-
6-
fs.readFile(__dirname + '/hack.css', 'utf-8', function(err, data) {
7-
if (err) {
8-
ipc.send('p3x-debug', {
9-
'messsage': 'hack.css is not working',
10-
error: err,
11-
});
12-
}
13-
p3x.onenote.hackCss = data;
14-
});
15-
*/
16-
173
const Store = require('electron-store');
184
const conf = new Store();
195
let translationKey = conf.get('lang')

0 commit comments

Comments
 (0)