Nw.js: nw2: Window.setBadgeLabel and Window.setProgressBar are not working

Created on 5 May 2020  路  6Comments  路  Source: nwjs/nw.js

NWJS Version : 0.44.6, 0.45.4
Operating System : Windows 10 x64

Expected behavior

methods must work as expected

Actual behavior

methods are not working and there is an error in console:

Unchecked runtime.lastError: The context from which the function was called did not have an associated app

How to reproduce

  1. run nw.js and show console
  2. enter commands:
var w = nw.Window.get()
w.setBadgeLabel('12');
w.setProgressBar(0.5)

Most helpful comment

This is fixed in git and will be available in the next nightly build.

All 6 comments

As stated in the documentation these methods are available only for Ubuntu, see here :

https://nwjs.readthedocs.io/en/latest/References/Window/#winsetprogressbarprogress

Docs isn't updated, this feature worked at Windows. See: https://github.com/nwjs/nw.js/issues/7170#issuecomment-538906580

@rogerwang Please update docs, thanks.

@DimPaDev Where did you see that functions work only on ubuntu? These notes in documentation applies only to the Linux family. On Windows and MacOS, these methods worked perfectly in the old mode without nw2. The problem is in nw2 mode.

The same for me,
NWJS Version : 0.47.3
Operating System : Windows 10 x64

Any updates on this?

0.41.3 still best for me! setBadgeForLabel(), requestAttention() and setProgressBar() works in Windows 10 x64 and OS X High Sierra

This is fixed in git and will be available in the next nightly build.

Was this page helpful?
0 / 5 - 0 ratings