jeandrek / histcontext

WebExtension to view context of history items & see past visits to webpage
https://addons.mozilla.org/en-US/firefox/addon/histcontext/
MIT License
0 stars 0 forks source link

show referer #1

Open jeandrek opened 2 months ago

jeandrek commented 8 hours ago

For some bizarre reason, VisitItems give you the visit ID of the referrer, but there is no API for getting a VisitItem from its ID. So, sadly, there's no simple way to do this in general. It's also unfortunate that browser.history.search does not give you the visits for the results.

jeandrek commented 8 hours ago

The workaround would be to check everything in the timeframe searched, to see if the visit ID matches, which in theory would work if the referrer is in that same timeframe, i.e. most of the time...but again, the result of searching that timeframe is an array of history items, not visit items. So it could check all visits, but that might be a bad idea when there's a colossal # of visits. OTOH checking up to a fixed # of visits for each item probably wouldn't help since getVisits would probably be the first problem. Visits do seem to be pruned however...so if the referer is visited frequently, there's possibly no solution.

jeandrek commented 7 hours ago

So it could check all visits

This works. It's enough work, though, to draw an as-connected-as-possible forest of the whole timeframe (or at least colour it).