Justoverclock well, I just noticed that the scrubber has a Scrubber-index
and Scrubber-count
values. You could do something like:
current_post = parseInt(globalThis.window.document.querySelector('.DiscussionPage-discussion .Scrubber-info .Scrubber-index').innerText);
max_posts = parseInt(globalThis.window.document.querySelector('.DiscussionPage-discussion .Scrubber-info .Scrubber-count').innerText);
console.log(`You have read ${current_post} out of ${max_posts} posts.`);
This logs current post out of max. posts to the console. You can extend this with your own login to update the progress when you scroll down a bit. No API calls needed.
However, this solution won't work for mobile (because the scrubber is not visible here). You will probably have to use an API call to obtain the max. comment count in this case, and then grab current post number from URL or somewhere else.
Note: I am not an extension developer, so there is probably a better way around this (eg.: passing the info from backend)