Skip to content

Instantly share code, notes, and snippets.

@erickzhao
Created October 15, 2020 20:17
Show Gist options
  • Select an option

  • Save erickzhao/d6c560b3798fb95ca81911a893be06a0 to your computer and use it in GitHub Desktop.

Select an option

Save erickzhao/d6c560b3798fb95ca81911a893be06a0 to your computer and use it in GitHub Desktop.
Electron Fiddle Gist
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<link rel="stylesheet" type="text/css" href="./styles.css">
</head>
<body>
<h1>Hello World!</h1>
<!-- All of the Node.js APIs are available in this renderer process. -->
We are using Node.js <script>document.write(process.versions.node)</script>,
Chromium <script>document.write(process.versions.chrome)</script>,
and Electron <script>document.write(process.versions.electron)</script>.
<script>
// You can also require other files to run in this process
require('./renderer.js')
</script>
</body>
</html>
//potente
const { app, BrowserWindow, protocol } = require('electron');
// let cmdArgs = process.argv.slice(2);
const createWindow = () => {
// Create the browser window.
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
backgroundColor: '#2e2c29',
});
mainWindow.loadURL('https://github.com')
// Remove top menu
mainWindow.removeMenu()
// Load gracefully
mainWindow.once('ready-to-show', () => {
win.show()
})
};
app.on('ready', createWindow);
app.whenReady(createWindow).then(() => {
protocol.registerFileProtocol('meet', (request, callback) => {
const url = request.url.substr(7)
callback({ path: path.normalize(`${__dirname}/${url}`) })
})
})
// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
});
// This file is required by the index.html file and will
// be executed in the renderer process for that window.
// All of the Node.js APIs are available in this process.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment