16 lines
374 B
JavaScript
16 lines
374 B
JavaScript
const { Webview } = require("webview-nodejs");
|
|
|
|
let w = new Webview();
|
|
w.title("zhdiary");
|
|
w.size(1920, 1280);
|
|
w.init(/* js */ `
|
|
document.addEventListener('click', (ev) => {
|
|
if (ev.target.matches('a')) {
|
|
const href = ev.target.href || '';
|
|
if (href.startsWith('https://')) ev.preventDefault();
|
|
}
|
|
})
|
|
`);
|
|
w.navigate("http://localhost:50156");
|
|
w.show();
|