extra window now works in browsers too

This commit is contained in:
zadam 2020-04-27 22:29:39 +02:00
parent 907cdd8fcb
commit ffbfccb701
4 changed files with 8 additions and 8 deletions

6
package-lock.json generated
View File

@ -3335,9 +3335,9 @@
}
},
"electron": {
"version": "9.0.0-beta.18",
"resolved": "https://registry.npmjs.org/electron/-/electron-9.0.0-beta.18.tgz",
"integrity": "sha512-mOdPB4nPc4kO2uwpvvbNZz0RDrRDIko/C8XFmOZmz7k3JaU7r0h/tLxdeypiqfLwxW/Bu1n+uwqG1X34i3fTEw==",
"version": "9.0.0-beta.20",
"resolved": "https://registry.npmjs.org/electron/-/electron-9.0.0-beta.20.tgz",
"integrity": "sha512-B3JDQRGYi/hS/a64wDx1Xnl8Z52rpBbysh+D4KOKL95NJ+MLVifgCzhu9yHIFNblB5fqz7PFzbyllJ6wAoQMQg==",
"dev": true,
"requires": {
"@electron/get": "^1.0.1",

View File

@ -78,7 +78,7 @@
"yazl": "^2.5.1"
},
"devDependencies": {
"electron": "9.0.0-beta.18",
"electron": "9.0.0-beta.20",
"electron-builder": "22.5.1",
"electron-packager": "14.2.1",
"electron-rebuild": "1.10.1",

View File

@ -108,9 +108,9 @@ class AppContext extends Component {
ipcRenderer.send('create-extra-window', {notePath});
}
else {
const url = 'http://127.0.0.1:37740/#' + notePath;
const url = window.location.protocol + '//' + window.location.host + window.location.pathname + '?extra=1#' + notePath;
window.open(url);
window.open(url, '', 'width=1000,height=800');
}
}
}

View File

@ -18,8 +18,8 @@ let setupWindow;
async function createExtraWindow(notePath) {
const {BrowserWindow} = require('electron');
const win = new BrowserWindow({
height: 600,
width: 800,
width: 1000,
height: 800,
title: 'Trilium Notes',
webPreferences: {
enableRemoteModule: true,