Expose counts of site content sources to the application code
Related to #11 (closed), in order to improve the visualization of the site content sources, we need to expose the counts tracked by the Ceno extension to Ceno's application code. Doing this will allow us to design Android-specific UI, rather than being hamstrung by the Ceno sources html/css/js pop-up. There are a few possible solutions,
-
Port the existing background.js code to kotlin, so the application code can get the counts itself. The existing js code is fairly complicated so it might prove to be a major headache to port it work on Android.
-
Set up a JSON endpoint in the Ceno extension that will respond with the current counts of sources for the current page. This is probably the best option, since it reuses the existing js code and creates a useful API endpoint that could be reused in desktop applications, though implementing this could have unexpected blockers.
-
Scrape the existing sources pop-up for the counts, and reformat them into the desired UI. This basically a quick-and-dirty version of option 2.
-
Something else, maybe web extensions have some other channel for exchanging data between the app and the extension, or maybe we could build the tracking of sources directly into the ouinet library (though this is likely not feasible since ouinet has no concept of a single contiguous webpage).