Class: NavigationHistory
Class: NavigationHistory
Manage a list of navigation entries, representing the user's browsing history within the application.
Process: Main
This class is not exported from the 'electron' module. Elle n'est disponible qu'en tant que valeur de retour des autres méthodes dans l'API Electron.
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.
Méthodes d’instance
navigationHistory.canGoBack()
Returns boolean - Whether the browser can go back to previous web page.
navigationHistory.canGoForward()
Returns boolean - Whether the browser can go forward to next web page.
navigationHistory.canGoToOffset(offset)
offsetInteger
Returns boolean - Whether the web page can go to the specified offset from the current entry.
navigationHistory.clear()
Efface l'historique de navigation.
navigationHistory.getActiveIndex()
Returns Integer - The index of the current page, from which we would go back/forward or reload.
navigationHistory.getEntryAtIndex(index)
indexInteger
Returns NavigationEntry - 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.goBack()
Fait revenir le navigateur en arrière d'une page web.
navigationHistory.goForward()
Fait avancer le navigateur d'une page web.
navigationHistory.goToIndex(index)
indexInteger
Fait naviguer le navigateur vers l'index de page web absolu spécifié.
navigationHistory.goToOffset(offset)
offsetInteger
Navigates to the specified offset from the current entry.
navigationHistory.length()
Returns Integer - History length.
navigationHistory.removeEntryAtIndex(index)
indexInteger
Removes the navigation entry at the given index. Can't remove entry at the "current active index".
Returns boolean - Whether the navigation entry was removed from the webContents history.
navigationHistory.getAllEntries()
Returns NavigationEntry[] - WebContents complete history.