AdguardTeam / AdGuardMV3

AdGuard browser extension prototype based on the new Manifest V3
https://adguard.com/
GNU General Public License v3.0
143 stars 13 forks source link

[PoC] Show basic stats #2

Closed raed667 closed 1 year ago

raed667 commented 1 year ago

This is just some toy code thrown together rapidly to test the concept

I managed to display some basic stats about resources blocked.

Pretty sure the implementation is missing a few things since the count from the engine doesn't strictly match what the declarative badge is showing.

image

Any feedback/critique on the idea is more than welcome !

ameshkov commented 1 year ago

Cool! The approach is pretty much what we were thinking about.

The only downside I am seeing is that there's the second tsurlfilter engine instance when we already have one up for cosmetic rules, we'll probably implement it as a part of tswebextension.

Also, when Chrome finally comes up with https://github.com/w3c/webextensions/issues/170 we'll need to revamp the whole design once again. tsurlfilter will be moved to the offscreen document instance and kept alive all the time and we'll get another layer of messaging: content script/popup <-> service worker <-> offscreen document.

raed667 commented 1 year ago

That makes a whole lot of sense, thanks for the insight !