Skip to content

Restore window history when reopening Agregore #313

@RangerMauve

Description

@RangerMauve

Right now we preserve the position, suze, url, and scroll offset of windows to restore when Agregore starts. Other browsers are also preserving the page history so that you can navigate back or forward if you need. We should save this info when the app closes

TODO:

  • Use the webContents.navigationHistory API
  • Have a const for MAX_SAVED_HISTORY, default to 8 or 16 (or less?)
  • Modify [WindowManager.saveOpened][https://github.com/AgregoreWeb/agregore-browser/blob/master/src/window.js#L235]
  • Get all the entries
  • get the index
  • If the entries length is greater than MAX_SAVED_HISTORY, remove the extra entries, reduce/increase the index to match.
  • Save this as history: {index, entries}
  • Modify openSaved
  • Fetch out the history and pass it to .open
  • Modify windowManager.open
  • Call window.web.navigationHistory.restore with the history object if it was provided before calling window.load
  • Test it's working! The max history bit especially might be prone to bugs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions