Browse Source

🎉 Initial commit

master
KaKi87 1 month ago
commit
44e58bb818
4 changed files with 1138 additions and 0 deletions
  1. +2
    -0
      .gitignore
  2. +21
    -0
      index.js
  3. +13
    -0
      package.json
  4. +1102
    -0
      yarn.lock

+ 2
- 0
.gitignore View File

@@ -0,0 +1,2 @@
.idea
node_modules

+ 21
- 0
index.js View File

@@ -0,0 +1,21 @@
const { app, BrowserWindow, session } = require('electron');
app.once('ready', async () => {
const window = new BrowserWindow({ show: false });
window.setMenuBarVisibility(false);
window.webContents.on('did-finish-load', () => window.show());
const { debugger: debug } = window.webContents;
debug.attach();
debug.on('message', async (event, method, { requestId }) => {
if(method !== 'Network.responseReceived') return;
try {
const { body } = await debug.sendCommand('Network.getResponseBody', { requestId });
const { token } = JSON.parse(body);
if(token){
await window.loadURL(`data:text/html;charset=utf-8,<body style="background-color: rgb(44, 47, 51)"><span style="color: white"><span style="font-family: sans-serif">${token}</span></span></body>`);
}
} catch(_){}
});
debug.sendCommand('Network.enable').then();
await window.loadURL('https://discord.com/login');
});
app.on('quit', () => session.defaultSession.clearStorageData());

+ 13
- 0
package.json View File

@@ -0,0 +1,13 @@
{
"name": "discord-token-getter",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"start": "./node_modules/.bin/electron ."
},
"devDependencies": {
"electron": "^10.1.3",
"electron-packager": "^15.1.0"
}
}

+ 1102
- 0
yarn.lock
File diff suppressed because it is too large
View File


Loading…
Cancel
Save