Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option for displaying the tab history #1496

Open
tarek2 opened this issue Feb 19, 2015 · 12 comments
Open

Add an option for displaying the tab history #1496

tarek2 opened this issue Feb 19, 2015 · 12 comments

Comments

@tarek2
Copy link

tarek2 commented Feb 19, 2015

It would be nice if vimium has the ability for displaying the history for the tab in a list to be activated by a keyboard shortcut.

@smblott-github
Copy link
Collaborator

Not sure if we want another command/option, but...

If we were to do this, it might be natural as a vomnibar mode.

@mrmr1993
Copy link
Contributor

Chrome doesn't currently have an API for this, but you could open/find an issue on the Chromium bug tracker to propose one. It's a pity because I'd really like to see this feature.

If you're interested in a challenge, it looks like you could make a decent attempt at hacking together such an API by

  • associating the relevant id from chrome.history with each event in chrome.webNavigation.onCommitted, and
  • keeping the tab history synced with the appropriate tab id by watching chrome.webNavigation.onTabReplaced.

From that point, it should be simple to hook into the Vomnibar and show the history there.

Not sure if we want another command/option

This seems like a good, useful feature. If this is really a terrible issue, then we could add it onto the history navigation commands (long hold for history — but which would require key handling in the frontend), or lose some low-value commands like url editing and pin tab instead.

Personally, I think we should be careful about adding new commands which don't add much value, but shouldn't not add good ones because we've hit some arbitrary boundary of "too many".

@1995eaton
Copy link

If I'm understanding this issue correctly, the requested feature is equivalent to the list of items shown when you right click the back button in the toolbar? If so, I ended up using chrome.tabs.onUpdated when I added the :tabhistory command to cVim (https://github.com/1995eaton/chromium-vim/blob/master/background_scripts/main.js#L52).

@mrmr1993
Copy link
Contributor

How do you deal with history like

Facebook home -> a Facebook profile -> Facebook home -> a Facebook event -> that first Facebook profile

and user actions on them? I can't see where/how you distinguish back/forward from the Facebook event, or how an original navigation is considered different from a back/forward.

It seems like your history could diverge from the tab's actual history quite quickly if you use back/forward a lot.

Edit: and history.popState/history.replaceState, which destroy the last history entry.

@1995eaton
Copy link

I only keep track of the history states that aren't duplicates. Rather than using the history object to navigate back and forth, I have the tab's history URLs opened in a new tab. I wanted to process the history states in a similar fashion to Chrome, but like you said, there doesn't appear to be an API to do this. When a history state is pushed/replaced, I simply add the URL to the TabHistory set if it isn't already in it.

@mrmr1993
Copy link
Contributor

Chromium issue for the API: 41321

The API has a design doc that's been approved, so it's just waiting on the blocking issue (236848), which seems to be progressing, albeit slowly.

I suggest we watch that issue and wait for the proper API to come out (although I would be interested to see a fully functioning polyfill!).

@gdh1995
Copy link
Contributor

gdh1995 commented Feb 26, 2015

Can we get a page's navigation history on the frontend? That is, a new Nav completer in vomnibar.js.

@mrmr1993
Copy link
Contributor

Can we get a page's navigation history on the frontend?

Reliably? No, sorry.

If there was a chrome API we could do this easily. If the Chromium devs decide to implement that or somebody creates an effective polyfill, then I'd love to add this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@mrmr1993 @smblott-github @1995eaton @gdh1995 @tarek2 and others