Search code examples
javascripthtmllicensingnode-webkitnw.js

Check that Html is using with Node-webkit or not?


I want the Html file only run with Node-webkit because of license purpose, not allow to run on any other browser (Chrome, Safari, Firefox...)

Can we check by the Html file that it's running with Node-webkit or not?


Solution

  • You can check for some of the node-webkit specific stuff, such as if process.versions has a node-webkit property:

    if (typeof process !== "undefined" && process.versions['node-webkit']) {
        console.log('You are using node-webkit!');    
    }