Skip to content

Instantly share code, notes, and snippets.

View t57ser's full-sized avatar

t57ser

  • Vienna, Austria
View GitHub Profile
@t57ser
t57ser / main.js
Created May 19, 2025 12:38
navigator.credentials.get with conditional mediation brings up a popup
const {app, BrowserWindow} = require('electron')
const electron = require('electron');
const path = require("path");
const fs = require('fs');
let mainWindow
function createWindow() {
const mainWindow1 = new BrowserWindow({
x: 0,
@t57ser
t57ser / main.js
Created May 5, 2025 09:17
Blue background appears when showing window
const electron = require("electron");
const { app, BrowserWindow, BrowserView, session, ipcMain } = require("electron");
const path = require("path");
app.on("ready", () => {
let windows = [];
function start() {
let mainWindow = new BrowserWindow({
show: false,
@t57ser
t57ser / main.js
Created March 5, 2025 12:19
Setting user agent of webContents created via window.open does not work
const {app, BrowserWindow} = require('electron')
const electron = require('electron');
const path = require("path");
const fs = require('fs');
let mainWindow
function createWindow () {
const mainWindow1 = new BrowserWindow({
x: 0,
y: 0,
@t57ser
t57ser / main.js
Created January 16, 2025 10:44
Electron Crash when navigating in will-frame-navigate
const {app, BrowserWindow} = require('electron')
const electron = require('electron');
let mainWindow
function createWindow () {
const mainWindow1 = new BrowserWindow({
x: 0,
y: 0,
width: 1000,
@t57ser
t57ser / main.js
Created January 10, 2025 08:58
[webRequest.onHeadersReceived] Not all requests show modified headers
const {app, BrowserWindow} = require('electron')
const electron = require('electron');
let mainWindow
function createWindow () {
const mainWindow1 = new BrowserWindow({
x: 0,
y: 0,
width: 1000,
@t57ser
t57ser / index.html
Created September 20, 2024 12:11
Electron Crash when trying to focus a webview
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<webview src="https://www.google.com"/>
</body>
</html>
@t57ser
t57ser / main.js
Created August 8, 2024 09:39
WebContentsView does not apply bounds until visible
const {app, BrowserWindow, ipcMain, WebContentsView} = require('electron')
const path = require('path')
let mainWindow
function createWindow () {
const mainWindow1 = new BrowserWindow({
x: 0,
y: 0,
@t57ser
t57ser / main.js
Created June 24, 2024 12:18
[Bug]: Using app.disableHardwareAcceleration() makes window disappear
const {app, BrowserWindow, ipcMain, WebContentsView} = require('electron')
let mainWindow
function createWindow () {
const mainWindow1 = new BrowserWindow({
x: 0,
y: 0,
width: 1000,
@t57ser
t57ser / main.js
Created June 19, 2024 07:25
webContentsView steals focus after loading url
const {app, BrowserWindow, ipcMain, WebContentsView} = require('electron')
let mainWindow
function createWindow () {
const mainWindow1 = new BrowserWindow({
x: 0,
y: 0,
width: 1000,
@t57ser
t57ser / main.js
Created February 20, 2024 13:19
Electron 29 incorrect key
let { app, BrowserWindow, ipcMain, session} = require("electron")
const electron = require("electron");
function createWindow() {
let win = new BrowserWindow({
})
win.loadURL("https://www.example.com");
win.webContents.on("before-input-event", (event, input) => {
console.log("before-input-event",input);