mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
feat: add fileSystem to ses.setPermissionCheckHandler (#48327)
feat: add fileSystem to ses.setPermissionCheckHandler Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
1
spec/fixtures/file-system/persist.txt
vendored
Normal file
1
spec/fixtures/file-system/persist.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
hello persist
|
||||
@@ -10,13 +10,17 @@
|
||||
<script>
|
||||
const { ipcRenderer } = require('electron')
|
||||
|
||||
let fileHandle = null;
|
||||
let handle = null;
|
||||
let sent = false;
|
||||
window.document.onpaste = async (event) => {
|
||||
const fileItem = event.clipboardData.items[0];
|
||||
fileHandle = await fileItem.getAsFileSystemHandle();
|
||||
handle = await fileItem.getAsFileSystemHandle();
|
||||
if (!sent) {
|
||||
ipcRenderer.send('did-create-file-handle');
|
||||
if (handle.kind === 'file') {
|
||||
ipcRenderer.send('did-create-file-handle');
|
||||
} else {
|
||||
ipcRenderer.send('did-create-directory-handle');
|
||||
}
|
||||
sent = true;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user