Last active
April 6, 2022 12:50
-
-
Save vanowm/36370e420a7d8702706280603778a57a to your computer and use it in GitHub Desktop.
Collapsed console.trace() ( https://stackoverflow.com/q/71766903 )
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self'"> | |
<script src="renderer.js"></script> | |
</head> | |
</html> |
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 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() | |
}) |
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": "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" | |
} | |
} |
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 {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