Nativefier: --counter does not seem to be working

Created on 8 Dec 2016  路  4Comments  路  Source: jiahaog/nativefier

Description

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.

Steps to Reproduce Issue

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"

Specifications

  • Version of Nativefier (run $ nativefier --version): v7.0.1
  • Version of Node.js (run $ node --version): v7.2.0
  • OS: MacOS Sierra
  • Architecture <ARCH>
  • Stack trace from the error message (if any) - N/A
bug mac need-info

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mklaber picture mklaber  路  5Comments

ranzou06 picture ranzou06  路  3Comments

raulcraveiro picture raulcraveiro  路  4Comments

jjgalvez picture jjgalvez  路  3Comments

simonweil picture simonweil  路  5Comments