I built my app with the --counter option, and the titles for my site have (#) Site Name - Page Title. They are updated when new notifications come in from a websocket via AJAX with code like this:
document.title = document.title.replace(/^\(\d+\)/, "(" + unread_count + ")");
If I am missing something, or need to do something in a different fashion, please let me know, as I don't seem to be able to find any documentation specifying.
Build app using
nativefier --name "App Title" --platform osx --icon /path/to/my/logo.png --counter --fast-quit --maximize --disable-context-menu --disable-dev-tools "http://my.site.com"
$ nativefier --version): v7.0.1$ node --version): v7.2.0MacOS Sierra<ARCH>Actually, it does create the badges if the app does not have focus, but when it gets focus it clears them. This is directly opposed to the documentation: "Use a counter that persists even with window focus for the application badge...".
Also, although it is catching JS title updates, it seems to be using the old title, rather than the new one (i.e. if the title changes from (2) to (3), the badge shows 2).
@jasonivers https://github.com/jiahaog/nativefier/pull/256 was recently released as part of Nativefier 7.1.0, could you try it and see if --counter works better now? Thanks :)
Will try first thing on Monday.
That does seem to have fixed it. Thank you. It was keeping me from releasing a desktop app with nativefier, but now I can move ahead.