-
Notifications
You must be signed in to change notification settings - Fork 3
Available Data
Chrome has an API for accessing the browser history: https://developer.chrome.com/extensions/history
It allows your scripts to interact with the browser's record of visited pages.
From examples it looks like the API calls have to exist from within background js files, as opposed to content js files.
JS can make API calls to the browser too - it suggests creating an extension to the browser to achieve the additional functionality. Here's a good article about the anatomy of an extension: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Anatomy_of_a_WebExtension
Fundamentally, Chrome does not store the duration spent on a specific URL, so we need to add extra logic (eventlisteners, eventhandlers?) to manage this requirement.
In Chrome the browsing history stores things like:
- URL visited
- When URL was visited
- How many times URL was visited
The duration of the URL is measured based on if you clicked when the page loaded - so may not be a good representation of time spent on the page.