user3591153
user3591153

Reputation: 419

nwjs is there way to check if useing the sdk version?

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

Answers (2)

Function
Function

Reputation: 73

It seems that the correct way now is to check for

process.versions["nw-flavor"] === "sdk"

Upvotes: 3

Saket Patel
Saket Patel

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

Related Questions