TheMapSmith / history-extension

"Custom History Enhancements" is a Chrome extension that enhances browsing history navigation with features like a date picker and displaying access time, favicon, and title. Focused on privacy, it only reads local data without sharing any information. Experience an efficient way to explore your browsing history.
0 stars 0 forks source link

Linger Time? #9

Closed TheMapSmith closed 1 year ago

TheMapSmith commented 1 year ago

can other attributes be shown, such as how long the visit to the page was?

TheMapSmith commented 1 year ago

Unfortunately, the Chrome History API does not provide information about the duration of a visit to a page. The API provides details like the title, URL, and last visit time of the page, but it does not keep track of how long a user spent on a specific page.

If you're interested in tracking the time spent on a page, you would need to develop a separate functionality within the extension to monitor user activity on each tab. This would involve tracking when a tab becomes active, when it is switched to another tab, and when it is closed, and then calculating the time spent on each page accordingly. However, this would be beyond the scope of the current project and would require a different approach to data collection and storage.

TheMapSmith commented 1 year ago

The Chrome History API provides information about the user's browsing history. The main attributes exposed by the API are:

  1. id: A unique identifier for the history entry. It is a string value.
  2. url: The URL of the visited page. It is a string value.
  3. title: The title of the visited page. It is a string value.
  4. lastVisitTime: The time when the page was last visited, represented in milliseconds since the epoch (1 January 1970 00:00:00 UTC). It is a double value.
  5. visitCount: The total number of times the user has visited the page. It is an integer value.
  6. typedCount: The number of times the user has navigated to the page by typing the URL in the address bar or through the omnibox. It is an integer value.

These attributes are returned when you perform a search using chrome.history.search() and when you retrieve a specific history entry using chrome.history.getVisits().

In addition to these attributes, the API also provides methods to search, add, delete, and track changes in browsing history.

For more information about the Chrome History API, you can refer to the official documentation: https://developer.chrome.com/docs/extensions/reference/history/