Reputation: 419
If I run my program in nw.js I want to test whether it is sdk version or not, since I'll want different code to run depending on whether it is sdk or not. I've been searching for an answer but haven't been able to find anything. The only thing that pops up is how to check the version of nw.js, not whether it is a SDK build.
Upvotes: 2
Views: 827
Reputation: 73
It seems that the correct way now is to check for
process.versions["nw-flavor"] === "sdk"
Upvotes: 3
Reputation: 6683
I am using below code to check for dev mode
// Check if we are working with sdk version or production
// https://github.com/nwjs/nw.js/issues/5062
isDevMode: function() {
return (window.navigator.plugins.namedItem('Native Client') !== null);
},
Upvotes: 0