dhowe / AdNauseam

AdNauseam: Fight back against advertising surveillance
GNU General Public License v3.0
4.52k stars 189 forks source link

Value of collected ads wrong when pages change title dynamically #2247

Closed mneunomne closed 11 months ago

mneunomne commented 1 year ago

Sometimes the value displayed on the extension badge is not correct, showing 0 instead of the actual number of collected/visited ads.

Screen Shot 2022-12-30 at 10 03 27

Not sure how to reproduce yet, but it can occasionally happen. Will investigate more.

dhowe commented 1 year ago

Isn't that correct behavior for a page with no ads?

mneunomne commented 1 year ago

Ah true yes, I always get confused with this. Closing

mneunomne commented 1 year ago

Ok finally, now I caught it actually happening. Some pages change their titles dynamically, so when that happens, our counter goes back to zero.

Screenshot 2023-02-10 at 15 06 54

How to reproduce

get some ads collected on this page, then scroll it enough until the page title changes, it will make the collected ad number to down to Zero:

https://economictimes.indiatimes.com/news/economy/policy/draft-scheme-circulated-to-settle-disputes-related-to-govt-contracts/articleshow/97747627.cms

mneunomne commented 1 year ago

Actually, not only the page title changes, but the url itself, and you scroll through the website above. Don't think there is anything we can do about that. uBlock manages not to have the same issue.

mneunomne commented 11 months ago

@dhowe the question is:

Do we want to number on the badge to display the collected ads a specific page, or specific domain? Maybe domain makes more sense than page?

dhowe commented 11 months ago

For me page makes more sense, but I'm open to discussion as domain could work as well. But the question of time frame is not clear to me: what about visits to a domain from a previous session or a previous year (we might have many thousands of ads listed for, say, a search results page)? Would also involve a fair amount of implementation changes (eg scanning the admap for domain entries within a time window for each new ad detected), for what seems at best a minimal gain in user experience.

Regardless, this question does not relate to the issue in the ticket above, which I have marked as Won't fix since the assumption throughout the code base is that a URL change is, by definition, a page change.

Closing for now, but feel free to open a new ticket or discussion on the issue above, or the count-per-domain question if you think its warrants further discussion

mneunomne commented 11 months ago

Agreed. Closing