Skip to content

Instantly share code, notes, and snippets.

@asafrivni
asafrivni / index.html
Created June 19, 2023 13:47
[Bug] Child-window preload not running
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'">
<link href="./styles.css" rel="stylesheet">
<title>Hello World!</title>
</head>
<body>
@asafrivni
asafrivni / main.js
Created July 24, 2022 10:04
Child window UA Bug
const { app, BrowserWindow, session } = require('electron')
const path = require('path')
function createWindow () {
// Create the browser window.
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js')