mirror of
https://github.com/SrIzan10/shellshockers-webapp.git
synced 2026-06-06 01:06:56 +00:00
Added all files
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
node_modules/
|
||||
60581
easylist.txt
Normal file
60581
easylist.txt
Normal file
File diff suppressed because it is too large
Load Diff
BIN
icon256.ico
Normal file
BIN
icon256.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 422 KiB |
BIN
icon256.jpg
Normal file
BIN
icon256.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
68
index.js
Normal file
68
index.js
Normal file
@@ -0,0 +1,68 @@
|
||||
const { app, BrowserWindow } = require('electron')
|
||||
const client = require('discord-rich-presence')('975453682218983555');
|
||||
const { ElectronBlocker } = require('@cliqz/adblocker-electron');
|
||||
const { fetch } = require('cross-fetch');
|
||||
const updater = require('electron-simple-updater');
|
||||
const fs = require('fs');
|
||||
updater.init('https://updater.shellshockers.srizan.ml/updates.json');
|
||||
|
||||
// the url for the webpage, maybe I'll change it on later builds.
|
||||
function getUrlToLoad() {
|
||||
let url = 'https://shellshock.io/';
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
// rich presence yesyes
|
||||
|
||||
try {
|
||||
client.updatePresence({
|
||||
state: 'In the app',
|
||||
details: 'Killing eggs',
|
||||
largeImageKey: 'icon',
|
||||
instance: true
|
||||
});
|
||||
} catch (err) {
|
||||
// execution continues if it couldn't connect to Discord, but notify the user via the console that it couldn't connect
|
||||
console.log('Could not connect to Discord Rich Presence, so try restarting the app, Discord or your entire computer.');
|
||||
}
|
||||
|
||||
// window stuff
|
||||
async function createWindow () {
|
||||
const mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
autoHideMenuBar: true,
|
||||
icon: __dirname + './icon.png',
|
||||
title: "Shell Shockers",
|
||||
webPreferences: {
|
||||
nodeIntegration: false,
|
||||
contextIsolation: false,
|
||||
nodeIntegrationInSubFrames: true
|
||||
}
|
||||
})
|
||||
// adblocking magic help this took a long time helphelphelp
|
||||
blocker = ElectronBlocker.parse(fs.readFileSync('./easylist.txt', 'utf-8'));
|
||||
blocker.enableBlockingInSession(mainWindow.webContents.session);
|
||||
// override changing the page title for Shell Shockers
|
||||
mainWindow.on('page-title-updated', function(e) {
|
||||
e.preventDefault()
|
||||
});
|
||||
|
||||
mainWindow.loadURL(getUrlToLoad());
|
||||
}
|
||||
|
||||
|
||||
|
||||
// closing and opening app shit
|
||||
app.whenReady().then(createWindow)
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
app.on('activate', () => {
|
||||
if (BrowserWindow.getAllWindows().length === 0) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
2207
package-lock.json
generated
Normal file
2207
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
23
package.json
Normal file
23
package.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "shellshockers-webapp",
|
||||
"version": "2.0.0",
|
||||
"description": "Shell Shockers Webapp",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "electron ."
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@cliqz/adblocker-electron": "^1.23.7",
|
||||
"cross-fetch": "^3.1.5",
|
||||
"discord-rich-presence": "^0.0.8",
|
||||
"electron-simple-updater": "^2.0.11",
|
||||
"fetch": "^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"electron": "^18.2.3"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user