Files
zhdiary/webview.js
T
2026-03-17 18:04:04 +07:00

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();