You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/07/08 11:09:41 UTC
[GitHub] [cordova-plugin-device] cldtech edited a comment on issue #99: Add
support for electron platform
cldtech edited a comment on issue #99: Add support for electron platform
URL: https://github.com/apache/cordova-plugin-device/issues/99#issuecomment-509181270
This works for me as of today. Basically look for `window.cordova.platformId` for cordova and and don't forget to verify a `window.cordova.platformId=false` to detect regular browsers.
```javascript
function isElectron() {
//if electron or android
if(window.cordova.platformId === 'electron' || device.platform === 'android') {
}
//if browser
else if (device.platform === 'browser' && window.cordova.platformId !== 'electron') {
}
else {
console.log('Unknown platform!');
}
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org