Skip to content

Commit e8508aa

Browse files
chore: update ref to docs (🤖)
1 parent 38c0846 commit e8508aa

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

‎docs/latest/.sha

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
e845d20789367bdfce1d46549ea83a2716b16922
1+
e83b0f6c2350c2e122fd69ebaf326513ea331f62

‎docs/latest/api/app.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,22 @@ bar, and on macOS, you can visit it from dock menu.
782782

783783
Clears the recent documents list.
784784

785+
### `app.getRecentDocuments()` _macOS_ _Windows_
786+
787+
Returns `string[]` - An array containing documents in the most recent documents list.
788+
789+
```js
790+
const { app } = require('electron')
791+
792+
const path = require('node:path')
793+
794+
const file = path.join(app.getPath('desktop'), 'foo.txt')
795+
app.addRecentDocument(file)
796+
797+
const recents = app.getRecentDocuments()
798+
console.log(recents) // ['/path/to/desktop/foo.txt'}
799+
```
800+
785801
### `app.setAsDefaultProtocolClient(protocol[, path, args])`
786802

787803
* `protocol` string - The name of your protocol, without `://`. For example,

‎docs/latest/tutorial/recent-documents.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ To clear the list of recent documents, use the
7777
In this guide, the list of documents is cleared once all windows have been
7878
closed.
7979

80+
#### Accessing the list of recent documents
81+
82+
To access the list of recent documents, use the
83+
[app.getRecentDocuments][getrecentdocuments] API.
84+
8085
## Additional information
8186

8287
### Windows Notes
@@ -138,5 +143,6 @@ of `app` module will be emitted for it.
138143
[dock-menu-image]: https://cloud.githubusercontent.com/assets/639601/5069610/2aa80758-6e97-11e4-8cfb-c1a414a10774.png
139144
[addrecentdocument]: ../api/app.md#appaddrecentdocumentpath-macos-windows
140145
[clearrecentdocuments]: ../api/app.md#appclearrecentdocuments-macos-windows
146+
[getrecentdocuments]: ../api/app.md#appgetrecentdocuments-macos-windows
141147
[app-registration]: https://learn.microsoft.com/en-us/windows/win32/shell/app-registration
142148
[menu-item-image]: https://user-images.githubusercontent.com/3168941/33003655-ea601c3a-cd70-11e7-97fa-7c062149cfb1.png

0 commit comments

Comments
 (0)