Skip to content

Show the number of unseen threads in the browser icon #5

@j127

Description

@j127

It might be nice to show unread post count on the browser icon. Here are examples from other extensions.

browser action icons

The extension has CORS access to the forum, so a snippet like this should work for getting the number of unread threads/topics.

fetch('https://forum.codeselfstudy.com/notifications.json?recent=true')
    .then(res => res.json())
    .then(json => {
        const numUnseenTopics = json['notifications']
            .filter(n => n.read == false)
            .length;
        console.log('number of unseen topics', numUnseenTopics);
    });

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions