docs: document webkitdirectory breaking change (#20934)
* chore: empty folder structure * chore: PR template * docs: add `webkitdirectory` change in Electron 7 * linguist? * link * Delete hacktoberfest.md
This commit is contained in:
parent
98844c20a7
commit
ba85d4c3bb
1 changed files with 34 additions and 1 deletions
|
@ -158,7 +158,7 @@ const idleTime = getSystemIdleTime()
|
||||||
### webFrame Isolated World APIs
|
### webFrame Isolated World APIs
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// Removed in Elecron 7.0
|
// Removed in Electron 7.0
|
||||||
webFrame.setIsolatedWorldContentSecurityPolicy(worldId, csp)
|
webFrame.setIsolatedWorldContentSecurityPolicy(worldId, csp)
|
||||||
webFrame.setIsolatedWorldHumanReadableName(worldId, name)
|
webFrame.setIsolatedWorldHumanReadableName(worldId, name)
|
||||||
webFrame.setIsolatedWorldSecurityOrigin(worldId, securityOrigin)
|
webFrame.setIsolatedWorldSecurityOrigin(worldId, securityOrigin)
|
||||||
|
@ -176,6 +176,39 @@ webFrame.setIsolatedWorldInfo(
|
||||||
|
|
||||||
This property was removed in Chromium 77, and as such is no longer available.
|
This property was removed in Chromium 77, and as such is no longer available.
|
||||||
|
|
||||||
|
### `webkitdirectory` attribute for `<input type="file"/>`
|
||||||
|
|
||||||
|
The `webkitdirectory` property on HTML file inputs allows them to select folders.
|
||||||
|
Previous versions of Electron had an incorrect implementation where the `event.target.files`
|
||||||
|
of the input returned a `FileList` that returned one `File` corresponding to the selected folder.
|
||||||
|
|
||||||
|
As of Electron 7, that `FileList` is now list of all files contained within
|
||||||
|
the folder, similarly to Chrome, Firefox, and Edge
|
||||||
|
([link to MDN docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory)).
|
||||||
|
|
||||||
|
As an illustration, take a folder with this structure:
|
||||||
|
```console
|
||||||
|
folder
|
||||||
|
├── file1
|
||||||
|
├── file2
|
||||||
|
└── file3
|
||||||
|
```
|
||||||
|
|
||||||
|
In Electron <=6, this would return a `FileList` with a `File` object for:
|
||||||
|
```console
|
||||||
|
path/to/folder
|
||||||
|
```
|
||||||
|
|
||||||
|
In Electron 7, this now returns a `FileList` with a `File` object for:
|
||||||
|
```console
|
||||||
|
/path/to/folder/file3
|
||||||
|
/path/to/folder/file2
|
||||||
|
/path/to/folder/file1
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that `webkitdirectory` no longer exposes the path to the selected folder.
|
||||||
|
If you require the path to the selected folder rather than the folder contents,
|
||||||
|
see the `dialog.showOpenDialog` API ([link](https://github.com/electron/electron/blob/master/docs/api/dialog.md#dialogshowopendialogbrowserwindow-options)).
|
||||||
## Planned Breaking API Changes (6.0)
|
## Planned Breaking API Changes (6.0)
|
||||||
|
|
||||||
### `win.setMenu(null)`
|
### `win.setMenu(null)`
|
||||||
|
|
Loading…
Add table
Reference in a new issue