It is a add-on for Firefox. It adds container name to the end of document title. If you use Multi-Account Containers and time tracker application, this add-on helps to separate browser activities.
For Firefox see Firefox Add-ons
Add-on inject script
document.title = document.title + ` [${containerName}]`API is scripting.executeScript(). This API does not work on some sites (e.g., developer.mozilla.org). The second variant is windows.update(). But it adds a string to the beginning of the browser window's title. So it changes the user experience.
The containerName is got from Contextual identities. If tab has no container, containerName = default.
The add-on listens to events: tabs.onActivated and tabs.onUpdated. An active tab switch, a document title change(some sites set title dynamically) and a document status update (wait until tab is loaded).
Install web-ext
npm install --global web-ext
Check code
web-ext lint
Load temporary add-on in browser with containers.
Package
web-ext build