Skip to content

Instantly share code, notes, and snippets.

@vanowm
Last active April 6, 2022 12:50
Show Gist options
  • Save vanowm/36370e420a7d8702706280603778a57a to your computer and use it in GitHub Desktop.
Save vanowm/36370e420a7d8702706280603778a57a to your computer and use it in GitHub Desktop.
Collapsed console.trace() ( https://stackoverflow.com/q/71766903 )
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self'">
<script src="renderer.js"></script>
</head>
</html>
const { app, BrowserWindow } = require('electron')
const path = require('path')
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS']=true
function createWindow () {
const mainWindow = new BrowserWindow({
width: 1000,
height: 800,
})
mainWindow.loadFile('index.html')
mainWindow.webContents.openDevTools()
}
app.whenReady().then(() => {
createWindow()
app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})
{
"name": "daily-smile-trouble-xga11",
"productName": "daily-smile-trouble-xga11",
"description": "My Electron application description",
"keywords": [],
"main": "./main.js",
"version": "1.0.0",
"author": "V@no",
"scripts": {
"start": "electron ."
},
"dependencies": {},
"devDependencies": {
"electron": "18.0.2"
}
}
{
const {groupCollapsed, groupEnd, trace} = console;
console.trace = ((...args) =>
{
groupCollapsed(...args);
trace("");
groupEnd();
}).bind(console);
}
(()=>(()=>console.trace("test"))())();//only shows one entry...wtf!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment