Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript get browser is electron

function isElectron() {
    // Renderer process
    if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') {
        return true;
    }

    // Main process
    if (typeof process !== 'undefined' && typeof process.versions === 'object' && !!process.versions.electron) {
        return true;
    }

    // Detect the user agent when the `nodeIntegration` option is set to true
    if (typeof navigator === 'object' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Electron') >= 0) {
        return true;
    }

    return false;
}

if(isElectron()){
    console.log("Electron aww yeahhh !");
}else{
    console.log("Running in other platform as a normal browser");
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to get only citnames in google maps api js 
Javascript :: aos library slow animation angular 
Javascript :: model to js 
Javascript :: using a variable in regex javascript with boundary marker 
Javascript :: quasar composition api $q 
Javascript :: puppeteer open browser authentication facebook 
Javascript :: mdns javascript 
Javascript :: iframe set value on input outside js 
Javascript :: list pci express version command line 
Javascript :: understand frontend 
Javascript :: LogRocket 
Javascript :: scrollspyNav react 
Javascript :: js replace blogger thumb 
Javascript :: angry professor javascript 
Javascript :: js go to see history 
Javascript :: configure column menu in kendo grid angular to hae only locked 
Javascript :: _40 0 _55 null _65 0 _72 null react native fetch 
Javascript :: this.setState is undefined inside a async function in js 
Javascript :: parent folder of file extendscript 
Javascript :: coldfusion cfscript cflocation 
Javascript :: react native sovrapporre immagini 
Javascript :: how to call javascript method using selectlist on change in vf page 
Javascript :: how to set time with jwt token in node js 
Javascript :: react redux cheat sheet 
Javascript :: rename object keys using regexp 
Javascript :: react.common.JavascriptException: Error: invalid host 
Javascript :: javascript repace enter event with another character 
Javascript :: svelte reactive async 
Javascript :: V2271823410017645510 
Javascript :: september 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =