Skip to content

Commit a63f614

Browse files
authored
docs: clarify navigationhistory offsets (electron#45616)
* docs: clarify navigationhistory offsets * "relative offset"
1 parent 2a383e9 commit a63f614

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

docs/api/navigation-history.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,16 @@
55
Process: [Main](../glossary.md#main-process)<br />
66
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
77

8-
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.
8+
Each [NavigationEntry](./structures/navigation-entry.md) corresponds to a specific visited page.
9+
The indexing system follows a sequential order, where the entry for the earliest visited
10+
page is at index 0 and the entry for the most recent visited page is at index N.
11+
12+
Some APIs in this class also accept an _offset_, which is an integer representing the relative
13+
position of an index from the current entry according to the above indexing system (i.e. an offset
14+
value of `1` would represent going forward in history by one page).
15+
16+
Maintaining this ordered list of navigation entries enables seamless navigation both backward and
17+
forward through the user's browsing history.
918

1019
### Instance Methods
1120

@@ -21,7 +30,7 @@ Returns `boolean` - Whether the browser can go forward to next web page.
2130

2231
* `offset` Integer
2332

24-
Returns `boolean` - Whether the web page can go to the specified `offset` from the current entry.
33+
Returns `boolean` - Whether the web page can go to the specified relative `offset` from the current entry.
2534

2635
#### `navigationHistory.clear()`
2736

@@ -57,7 +66,7 @@ Navigates browser to the specified absolute web page index.
5766

5867
* `offset` Integer
5968

60-
Navigates to the specified offset from the current entry.
69+
Navigates to the specified relative offset from the current entry.
6170

6271
#### `navigationHistory.length()`
6372

0 commit comments

Comments
 (0)