Skip to content

Commit

Permalink
fix: add missing index arg in navigationHistory.canGoToOffset (elec…
Browse files Browse the repository at this point in the history
…tron#44989)

fix: add missing arg
  • Loading branch information
alicelovescake authored Dec 12, 2024
1 parent 6961e94 commit a5b4339
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/browser/api/web-contents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,9 @@ WebContents.prototype.canGoForward = function () {
};

const canGoToOffsetDeprecated = deprecate.warnOnce('webContents.canGoToOffset', 'webContents.navigationHistory.canGoToOffset');
WebContents.prototype.canGoToOffset = function () {
WebContents.prototype.canGoToOffset = function (index: number) {
canGoToOffsetDeprecated();
return this._canGoToOffset();
return this._canGoToOffset(index);
};

const clearHistoryDeprecated = deprecate.warnOnce('webContents.clearHistory', 'webContents.navigationHistory.clear');
Expand Down
2 changes: 1 addition & 1 deletion typings/internal-electron.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ declare namespace Electron {
_historyLength(): number;
_canGoBack(): boolean;
_canGoForward(): boolean;
_canGoToOffset(): boolean;
_canGoToOffset(index: number): boolean;
_goBack(): void;
_goForward(): void;
_goToOffset(index: number): void;
Expand Down

0 comments on commit a5b4339

Please sign in to comment.