Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
navigationHistory.getEntryAtIndex(int index)
method (#41662)
* feat: add `navigationHistory.getEntryAtIndex(int index)` method (#41577) * test: fix flaky tests by replacing real urls with data urls * test: remove hardcoded url
- Loading branch information
1 parent
e6417c7
commit 9056dd7
Showing
9 changed files
with
148 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
## Class: NavigationHistory | ||
|
||
> Manage a list of navigation entries, representing the user's browsing history within the application. | ||
Process: [Main](../glossary.md#main-process)<br /> | ||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._ | ||
|
||
Each navigation entry corresponds to a specific page. The indexing system follows a sequential order, where the first available navigation entry is at index 0, representing the earliest visited page, and the latest navigation entry is at index N, representing the most recent page. Maintaining this ordered list of navigation entries enables seamless navigation both backward and forward through the user's browsing history. | ||
|
||
### Instance Methods | ||
|
||
#### `navigationHistory.getActiveIndex()` | ||
|
||
Returns `Integer` - The index of the current page, from which we would go back/forward or reload. | ||
|
||
#### `navigationHistory.getEntryAtIndex(index)` | ||
|
||
* `index` Integer | ||
|
||
Returns `Object`: | ||
|
||
* `url` string - The URL of the navigation entry at the given index. | ||
* `title` string - The page title of the navigation entry at the given index. | ||
|
||
If index is out of bounds (greater than history length or less than 0), null will be returned. | ||
|
||
#### `navigationHistory.length()` | ||
|
||
Returns `Integer` - History length. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters