Last active
December 1, 2022 20:02
-
-
Save jeremyspiegel/f55a7257b2b312b00e20aa63777b7f9a to your computer and use it in GitHub Desktop.
dark-mode-text-popup-bug
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
const {app, BrowserWindow} = require('electron') | |
const http = require('http') | |
http | |
.createServer((request, response) => { | |
if (request.url === '/popup') { | |
response.writeHead(200, {'content-type': 'text/plain; charset=utf-8'}) | |
response.end('test') | |
} else { | |
response.writeHead(200, {'content-type': 'text/html; charset=utf-8'}) | |
response.end(`<html><body><button onclick="window.open('/popup')">Open Window</button></body></html>`) | |
} | |
}) | |
.listen(2000); | |
app.whenReady().then(() => { | |
const mainWindow = new BrowserWindow({width: 200, height: 200}) | |
mainWindow.webContents.setWindowOpenHandler(() => ({action: 'allow'})) | |
mainWindow.loadURL('http://localhost:2000') | |
}) |
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": "exciting-spring-drink-8h31j", | |
"productName": "exciting-spring-drink-8h31j", | |
"description": "My Electron application description", | |
"keywords": [], | |
"main": "./main.js", | |
"version": "1.0.0", | |
"author": "jeremyspiegel", | |
"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