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
This commit is contained in:
parent
e6417c7084
commit
9056dd728a
9 changed files with 148 additions and 8 deletions
|
@ -531,6 +531,17 @@ WebContents.prototype._init = function () {
|
|||
enumerable: true
|
||||
});
|
||||
|
||||
// Add navigationHistory property which handles session history,
|
||||
// maintaining a list of navigation entries for backward and forward navigation.
|
||||
Object.defineProperty(this, 'navigationHistory', {
|
||||
value: {
|
||||
getActiveIndex: this._getActiveIndex.bind(this),
|
||||
length: this._historyLength.bind(this),
|
||||
getEntryAtIndex: this._getNavigationEntryAtIndex.bind(this)
|
||||
},
|
||||
writable: false
|
||||
});
|
||||
|
||||
// Dispatch IPC messages to the ipc module.
|
||||
this.on('-ipc-message' as any, function (this: Electron.WebContents, event: Electron.IpcMainEvent, internal: boolean, channel: string, args: any[]) {
|
||||
addSenderToEvent(event, this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue