Skip to content

Instantly share code, notes, and snippets.

View magnus-trent's full-sized avatar
🏗️
Shaping my dreams into a digital form

Magnus magnus-trent

🏗️
Shaping my dreams into a digital form
View GitHub Profile
@magnus-trent
magnus-trent / index.html
Last active October 18, 2024 02:23
WebContents lifecycle (window and view)
<!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'">
<title>Hello World!</title>
</head>
@magnus-trent
magnus-trent / index.html
Created October 19, 2024 03:37
Experimental Shape Rendering
<!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'">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
@magnus-trent
magnus-trent / main.js
Last active December 4, 2024 18:29
Simple Spellcheck for Views
// A BrowserView can be used to embed additional web content into a BrowserWindow.
// It is like a child window, except that it is positioned relative to its owning
// window. It is meant to be an alternative to the webview tag.
//
// For more info, see:
// https://electronjs.org/docs/api/browser-view
// In the main process.
const { BrowserView, BrowserWindow, app, Menu, MenuItem } = require('electron/main')