-
Notifications
You must be signed in to change notification settings - Fork 56
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
API to query the navigation history of a specific tab #203
Comments
Perhaps there's no useful overlap, but it might be worth considering if any parts of this should align with the proposed navigation API at https://github.com/WICG/navigation-api/blob/main/README.md. That API only applies to same-origin navigations, supports mutation of history, and doesn't expose things like the title, favicon, etc. so it might not be relevant. |
The outcome of the discussion is generally favorable towards the feature, but there are concerns over potential privacy issues with exposing the history of individual tabs. More details are in the meeting notes at https://github.com/w3c/webextensions/blob/main/_minutes/2022-04-28-wecg.md, which will be available in once #206 is merged. |
I just want to add that along with this API something like a |
The
tabs
extension API currently has thegoBack
andgoForward
methods, which originated from a contributor at https://crbug.com/830622.In Firefox, a feature request was filed to ask for the possibility of determining whether it is possible to know whether a navigation is possible, at https://bugzilla.mozilla.org/show_bug.cgi?id=1760523. The proposal is to introduce the
canGoForward
andcanGoBack
methods. While the implementation is straightforward, I believe that we can do better than adding a new method for every possible use case. The general underlying feature is the ability to access the back-forward history of specific tabs. That feature request was filed a few years ago and has amassed hundreds of votes at https://bugzilla.mozilla.org/show_bug.cgi?id=1378651, and one in Chromium at https://crbug.com/41321.To avoid the unnecessary cost of retrieving this information, this information is not exposed via
tabs.Tab
by default, but via a new method, e.g.tabs.getBackForwardHistory(tabId)
that returns a list of objects, with the propertiesurl
,title
,favIconUrl
and a boolean that indicates whether the entry is the current entry. Since the retrieval of favicons could be expensive and not all use cases may need it, I would also be in favor of anoptions
parameter to the method that allows callers to opt in to receivingfavIconUrl
information. Thetabs
permission shall be required (either to use the method itself, or to read theurl
,title
andfaviconUrl
properties).Questions:
PS. Beyond accessing the back-forwards history, there is also a request for modifying the back-forwards history, at https://bugzilla.mozilla.org/show_bug.cgi?id=1381922. Writing to the back-forward history is more involved, e.g. for session managers there may be a need to write scroll offsets and
history.state
. Writing to the back-forward history is out of scope for this issue, but if there is interest beyond read-only access, it may be useful to account for that possibility in the design of the read-only API.The text was updated successfully, but these errors were encountered: