-
-
Save ajafff/8d9e8eb8cc0a7ec2297f2445c54f5526 to your computer and use it in GitHub Desktop.
plain text background
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Hello World!</title> | |
</head> | |
<body> | |
<h1>Hello World!</h1> | |
<a href="./plain.txt" target="_blank">click me</a> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Modules to control application life and create native browser window | |
const {app, BrowserWindow, nativeTheme} = require('electron') | |
const fs = require('fs'); | |
nativeTheme.themeSource = "dark"; | |
fs.writeFileSync("plain.txt", "hello world"); | |
app.on('web-contents-created', (_, wc) => { | |
// comment out this line to make dark background work | |
wc.setWindowOpenHandler(() => ({action: 'allow'})) | |
}) | |
function createWindow () { | |
// Create the browser window. | |
const mainWindow = new BrowserWindow({ | |
width: 800, | |
height: 600, | |
}) | |
// and load the index.html of the app. | |
mainWindow.loadFile('index.html') | |
} | |
app.whenReady().then(() => { | |
createWindow() | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "encouraging-bottle-accept-nhaux", | |
"productName": "encouraging-bottle-accept-nhaux", | |
"description": "My Electron application description", | |
"keywords": [], | |
"main": "./main.js", | |
"version": "1.0.0", | |
"author": "klaus.meinhardt", | |
"scripts": { | |
"start": "electron ." | |
}, | |
"dependencies": {}, | |
"devDependencies": { | |
"electron": "22.0.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment