I want to add back and forward navigation button to my browserWindow in my Electron App, but although with Firefox and chrome when we use the back navigation any form input are reloaded with cached data with Electron webview using goBack()function clear these everytime. Is there any setup, options or way of keeping the data ....
It isn't clear.
Electron documentation doesn't explicitly state whether Electron implements what is called BFCache or HistoryLists. It isn't clear from Electron source code either. I created relevant issue on Github.
Electron uses Chromium to implement BrowserWindow
. Situation with BFCache and Chromium itself isn't very clear. There are multiple issues that state
that BFCache isn't implemented in Chromium (455226 Chrome reinitializes all fields to the value they had on their initial presentation when history back is used, 510340 Investigate faster back/forward page navigation). Although I've seen in practice that BFCache works in Chrome.
You can save and restore form state using JavaScript, sessionStorage
and window load and unload events. But in this case you also need a mechanism to clearly identify input
nodes and store serialized files in case if form contains file inputs.
For more information check: