Event 'open' on app is triggered once
See original GitHub issueWin 10 (x64)
- NWjs 0.62.2 - ok
- NWjs 0.63.0 - fail
manifest.json:
{
"name": "test",
"version": "0.1",
"app": {
"background": {
"scripts": ["init.js"]
}
},
"permissions": [
"webview",
"<all_urls>",
"node",
"proxy"
]
}
init.js:
(function () {
// open dev tools
chrome.developerPrivate.openDevTools({ renderViewId: -1, renderProcessId: -1, extensionId: chrome.runtime.id });
// listener
nw.App.on('open', (params) => console.log('onOpen', params));
})();
test case:
nw.exe "https://nwjs.io" // open event is triggered
nw.exe "https://nwjs.io" // nothing
nw.exe "https://nwjs.io" // nothing
Issue Analytics
- State:
- Created a year ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Event triggers in Shortcuts on iPhone or iPad - Apple Support
Existing: Triggers your automation when a specific alarm goes off in the Clock app. (After you select this option, select an alarm from...
Read more >What is the javascript/window event called when app is ...
I have a requirement that I want to trigger a javascript function whenever my app in firefox os phone is launched. Below event...
Read more >Solved: Onchange event often triggers when screen becomes
Onchange event often triggers when screen becomes visible (date picker control) Greetings PowerAppers, I have a date picker control on an edit form...
Read more >Is First_open event counting when a user re-install an app?
This event is not triggered when a user downloads the app onto a device, but instead when he or she first uses it....
Read more >Simple Triggers | Apps Script - Google Developers
To use a simple trigger, simply create a function that uses one of these reserved function ... The event handler triggered when opening...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is fixed in git and will be available in the next nightly build.
I created a test to find this regression and it helped narrow-down the behavior. It seems that any event handlers attached to the
open
event are removed once they fire…This shows the bug in action. After the first
open
event, the remaining 5 events do not trigger the event handler:However, if the event handler is re-attached to the
open
event every time, it works as expected: