Skip to content

Commit 5638f28

Browse files
committed
p3x-robot sunday release 2017-11-2 14:52:06
1 parent 96170de commit 5638f28

File tree

6 files changed

+16
-104
lines changed

6 files changed

+16
-104
lines changed

README.md

+4-15
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This is an open source project. Just code.
1818

1919
### Built on Node
2020
```
21-
v8.9.0
21+
v9.0.0
2222
```
2323

2424
The ```async``` and ```await``` keywords are required.
@@ -33,20 +33,9 @@ https://nodejs.org/en/download/package-manager/
3333

3434
This is a Linux Onenote.
3535

36-
# There were lots of changes
37-
Please update. There is a new release as well.
38-
39-
Though, sometimes, or often, it still loops with the login.
40-
41-
Sometimes it works, sometimes it loops.
42-
43-
Working on it...
44-
45-
Electron is using Chrome 59. Since the latest real Chrome uses 62 and now always works (before it was giving the same error). I am sure, there is a bug in 59, so I am working on the hack or a new Electron Chrome release will be.
46-
47-
## Hacking Onenote Online
36+
# You cannot log in
4837

49-
Well, I spent 2 days hacking it, bit it looks like if you sign in a lot without log out, then you get this loop and get a Microsoft error, then you cannot do anything with it. **I think we need to wait until Electron will be updated to Chrome 62 at least and/or sign off trim.**
38+
I think it only happens, if you kill the OneNote Linux and you then login again a lot. So to be safe, always ```sign out```, it is on the top right!!!
5039

5140
# Some info about P3X Onenote vs VirtualBox
5241
If you have enough RAM or buffy workstation and you can install VirtualBox inside Windows and use the Marketplace based OneNote or install Office. I think, you do not need ```p3x-onenote``` at all.
@@ -102,7 +91,7 @@ Fedora: https://github.com/patrikx3/onenote/issues/3#issuecomment-312711801
10291

10392
---
10493

105-
[**P3X-ONENOTE**](https://pages.corifeus.com/onenote) Build v1.1.30-250
94+
[**P3X-ONENOTE**](https://pages.corifeus.com/onenote) Build v1.2.33-256
10695

10796
[![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=LFRV89WPRMMVE&lc=HU&item_name=Patrik%20Laszlo&item_number=patrikx3&currency_code=HUF&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted)
10897

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "p3x-onenote",
3-
"version": "1.1.29-249",
3+
"version": "1.2.33-256",
44
"description": "P3X Onenote Linux",
55
"main": "src/electron/app.js",
66
"corifeus": {
77
"prefix": "p3x-",
88
"publish": true,
99
"type": "p3x",
1010
"code": "Linux",
11-
"nodejs": "v8.9.0"
11+
"nodejs": "v9.0.0"
1212
},
1313
"bin": {
1414
"p3x-onenote": "bin/p3x-onenote.js"
@@ -34,11 +34,11 @@
3434
"dependencies": {
3535
"electron": "^1.8.2-beta.1",
3636
"configstore": "^3.1.1",
37-
"corifeus-utils": "^1.1.583-203"
37+
"corifeus-utils": "^1.1.587-206"
3838
},
3939
"devDependencies": {
40-
"corifeus-builder": "^1.7.950-202",
41-
"electron-builder": "^19.43.0"
40+
"corifeus-builder": "^1.7.956-206",
41+
"electron-builder": "^19.43.4"
4242
},
4343
"engines": {
4444
"node": ">=8.9.0"

src/electron/app.js

+4-54
Original file line numberDiff line numberDiff line change
@@ -25,52 +25,21 @@ if (isSecondInstance) {
2525

2626
const action = {
2727
restart: () => {
28-
mainWindow.webContents.session.clearStorageData(() => {
29-
// console.log('storage cleared');
30-
conf.clear();
31-
mainWindow.loadURL('file://' + __dirname + '/blank.html');
32-
mainWindow.show();
33-
})
34-
/*
3528
mainWindow.webContents.send('action', {
3629
action: 'restart'
3730
})
38-
*/
3931
},
4032
home: () => {
4133
mainWindow.show();
42-
mainWindow.webContents.session.clearStorageData(() => {
43-
conf.clear();
44-
mainWindow.loadURL('https://www.onenote.com/notebooks');
45-
})
46-
/*
4734
mainWindow.webContents.send('action', {
4835
action: 'home'
4936
})
50-
*/
5137
},
5238
corporate: () => {
5339
mainWindow.show();
54-
55-
mainWindow.webContents.session.clearStorageData(() => {
56-
conf.clear();
57-
mainWindow.loadURL('https://www.onenote.com/notebooks?auth=2&auth_upn=my_corporate_email_address');
58-
})
59-
60-
/*
6140
mainWindow.webContents.send('action', {
6241
action: 'corporate'
6342
})
64-
*/
65-
},
66-
'last-page': () => {
67-
mainWindow.show();
68-
69-
if (typeof conf.get('lastUrl') === 'string' && !conf.get('lastUrl').startsWith('file')) {
70-
mainWindow.loadURL(conf.get('lastUrl'));
71-
} else {
72-
mainWindow.loadURL('file://' + __dirname + '/blank.html');
73-
}
7443
},
7544
toggleVisible: () => {
7645
if (mainWindow === undefined) {
@@ -111,20 +80,15 @@ const menus = {
11180
}
11281
return [
11382
{
114-
label: 'Personal login',
83+
label: 'Personal home',
11584
click: action.home
11685
},
11786
{
118-
label: 'Corporate login',
87+
label: 'Corporate home',
11988
click: action.corporate
12089
},
12190
{
122-
label: 'Your last page',
123-
click: action['last-page']
124-
},
125-
{
126-
label: 'Clear session and logout',
127-
tooltip: 'You logout and can login again',
91+
label: 'First sign off, then click this menu option to clear the cache',
12892
click: action.restart
12993
},
13094
{
@@ -236,10 +200,6 @@ function setVisible(visible = true) {
236200
conf.set('visible', visible);
237201
createMenu();
238202
createTray()
239-
240-
if (typeof conf.get('lastUrl') === 'string' && !conf.get('lastUrl').startsWith('file')) {
241-
mainWindow.loadURL(conf.get('lastUrl'));
242-
}
243203
}
244204

245205

@@ -254,9 +214,7 @@ function createWindow() {
254214

255215
setVisible(conf.get('visible'));
256216

257-
// mainWindow.loadURL('file://' + __dirname + '/index.html');
258-
action.home();
259-
// mainWindow.loadURL('https://www.onenote.com/hdr');
217+
mainWindow.loadURL('file://' + __dirname + '/index.html');
260218

261219
mainWindow.on('minimize', function (event) {
262220
event.preventDefault()
@@ -271,14 +229,6 @@ function createWindow() {
271229
return false;
272230
});
273231

274-
mainWindow.on('page-title-updated', function(event, title) {
275-
if (Array.isArray(event.sender.history) && event.sender.history.length > 0) {
276-
const lastUrl = event.sender.history[event.sender.history.length - 1];
277-
// console.log(lastUrl);
278-
conf.set('lastUrl', lastUrl);
279-
}
280-
})
281-
282232
const windowBounds = conf.get('windowBounds');
283233
if (windowBounds !== null && windowBounds !== undefined) {
284234
mainWindow.setBounds(windowBounds);

src/electron/blank.html

-27
This file was deleted.

src/electron/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<html>
22
<head>
3-
<title>P3X OneNote</title>
3+
<title>P3X One Note</title>
44
<meta content="">
55
<link rel="icon" type="image/png" href="images/256x256.png" />
66
<link rel="stylesheet" type="text/css" href="css/style.css">
@@ -9,7 +9,7 @@
99

1010
<body onload="window.electronWindowSetup()">
1111

12-
<webview id="p3x-onenote-webview" src="https://www.onenote.com/hdr" allowpopups style="overflow: hidden; width:100%; height:100%;"></webview>
12+
<webview id="p3x-onenote-webview" src="https://www.onenote.com/notebooks" allowpopups style="overflow: hidden; width:100%; height:100%;"></webview>
1313

1414
</body>
1515
</html>

src/electron/js/preload.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ window.electronWindowSetup = function() {
4242
break;
4343

4444
case 'home':
45-
webview.src = 'https://www.onenote.com/hdr'
45+
webview.src = 'https://www.onenote.com/notebooks'
4646
break;
4747

4848
case 'corporate':

0 commit comments

Comments
 (0)