mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 05:02:50 +02:00
Merge remote-tracking branch 'origin/bundle-deps' into frame-sideload-features
# Conflicts: # app/main.js
This commit is contained in:
commit
ccf5f3e123
5 files changed
+68
-26
No files matched your search
+4
-2
@@ -236,8 +236,10 @@ async function firstRunCheck() {
|
||||
|
||||
// IPC only from our own page in our own window.
|
||||
function fromUi(e) {
|
||||
return !!(win && e.sender === win.webContents && url && e.senderFrame
|
||||
&& new URL(e.senderFrame.url).origin === new URL(url).origin);
|
||||
if (!win || e.sender !== win.webContents || !url || !e.senderFrame) return false;
|
||||
try {
|
||||
return new URL(e.senderFrame.url).origin === new URL(url).origin;
|
||||
} catch { return false; }
|
||||
}
|
||||
|
||||
ipcMain.handle("clipboard:read", (e) => fromUi(e) ? clipboard.readText() : "");
|
||||
|
||||
Reference in new issue
Block a user