mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 03:00:18 +02:00
Combines the three feature branches on bundle-deps. Conflicts in server.py,
index.html, preload.js, README and test_server.py keep both sides. The
web-install downloader now uses urllib's default HTTPS context, so the
bundled CA list from 770f26c applies to it on Windows too.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
18 lines
973 B
JavaScript
18 lines
973 B
JavaScript
// Lets the page read this computer's clipboard through Electron, so sending it
|
|
// to the Frame needs no pbpaste, PowerShell, xclip or wl-clipboard. Also tells
|
|
// the page where a dropped file or folder lives, so a folder can be sideloaded
|
|
// as a title without zipping it (the local server reads it from there).
|
|
// It also receives frame-control://install links (docs/web-install.md): only
|
|
// what the link asked for, never an install; the page asks the user first.
|
|
const { contextBridge, ipcRenderer, webUtils } = require("electron");
|
|
|
|
contextBridge.exposeInMainWorld("frameApp", {
|
|
readClipboard: () => ipcRenderer.invoke("clipboard:read"),
|
|
pathForFile: (file) => { try { return webUtils.getPathForFile(file) || ""; } catch { return ""; } },
|
|
onInstallLink: (cb) => {
|
|
ipcRenderer.removeAllListeners("install-link");
|
|
ipcRenderer.on("install-link", (_e, req) => cb({ kind: req.kind, target: req.target }));
|
|
ipcRenderer.send("install-link:ready");
|
|
},
|
|
});
|