Skip to content

Instantly share code, notes, and snippets.

@modster
Created November 14, 2021 09:50
Show Gist options
  • Save modster/7e3185599a3012b2b3be4c59ebb1d67c to your computer and use it in GitHub Desktop.
Save modster/7e3185599a3012b2b3be4c59ebb1d67c to your computer and use it in GitHub Desktop.
Electron preload process
// All of the Node.js APIs are available in the preload process.
// It has the same sandbox as a Chrome extension.
// The process.versions property returns an object listing the version
// strings of Node.js and its dependencies. process.versions.modules
// indicates the current ABI version, which is increased whenever a
// C++ API changes. Node.js will refuse to load modules that were compiled
// against a different module ABI version.
const { versions } = require('process')
window.addEventListener('DOMContentLoaded', () => {
console.log(versions)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment