question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

win.requestAttention() is not working > 0.40.x

See original GitHub issue

NWJS Version : 43.3-sdk Operating System : up-to-date Windows 10

I have a new error on my app, after upgrading from nw 0.36 to 0.43: Unchecked runtime.lastError: The context from which the function was called did not have an associated app window.

The error is described in the sources (https://github.com/nwjs/nw.js/blob/dc014348efa9bd4d1b9acdf285d50f6ed623203f/src/api/nw_window_api.cc#L126) and it states it should fire when no window is available.

The issue is that I do have a window, it’s described in the manifest, but it’s set to "show": false to prevent it from flashing.

What I tried:

  • downgrading to 40.2 works, error appears at 41.3 and remains after that.
  • checking chrome.runtime.lastError as soon as I can (it doesn’t get rid of the error, lastError is undefined no matter when I try to check it)
  • using "show": true in the manifest works but it then flashes before the application is ready to be shown, that’s the reason I used to spawn it as “show:false”.

I believe it’s a small bug, that doesn’t prevent anything but is annoying because it will be shown at each startup.

UPDATE

require('nw.gui').Window.get().requestAttention(true) is the culprit. It triggers the error runtime.lastError

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
SuperKirikcommented, Sep 8, 2020

I have [8316:11952:0908/204143.418:ERROR:nw_window_api.cc(605)] The context from which the function was called did not have an associated app window. when I do gui.Window.get().setBadgeLabel(‘12’);

NWJS Version : 0.47.3 Operating System : Windows 10 x64

0reactions
vankasteeljcommented, Oct 9, 2021

Hi, just to let you know it still is an issue on 0.57.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

nw2: Window.setBadgeLabel and Window.setProgressBar are ...
setProgressBar are not working #7464 ... setBadgeForLabel(), requestAttention() and setProgressBar() works in Windows 10 x64 and OS X High Sierra ...
Read more >
Window - NW.js Documentation
Window is a wrapper of the DOM's topmost window object. It has extended operations and can receive various window events. Every Window is...
Read more >
Window - NW.js Documentation - Read the Docs
Minimize the window to task bar on Windows, iconify the window on GTK, and miniaturize the window on Mac OS X. win.restore(). Restore...
Read more >
Rabbit 3000 Microprocessor User's Manual
Rabbit Semiconductor was formed expressly to design a a better microprocessor for use in small and medium-scale controllers. The first microprocessor was ...
Read more >
3rd Party Open Source Licenses - Zimbra
The names "Apache" and "Apache Software Foundation" must not be used to ... in part of the work of the FreeType Team, in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found