This repository has been archived by the owner on Nov 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
social.js
44 lines (37 loc) · 1.77 KB
/
social.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Social.js Zeno Client
By : Zeno Client Team
*/
// *** Import Modules ***
const { ipcRenderer, remote } = require('electron');
const { getID, getResourceSwapper } = require("./consts");
const fs = require("fs");
const Store = require("electron-store");
const store = new Store();
window.home = () => window.location.href = 'https://krunker.io/social.html';
ipcRenderer.on('home', window.home);
window.addEventListener("keydown", e => {
switch (e.key) {
case "F3": window.home(); break
case "F4": window.location.reload(); break;
case "F7": ipcRenderer.send("devtools"); break;
default: break;
}
});
document.addEventListener('DOMContentLoaded', () => {
let cssFile = (store.get("RS") && fs.existsSync(getResourceSwapper(remote) + "css/social_custom.css")) ? getResourceSwapper(remote) + "css/social_custom.css" : __dirname + "/assets/css/social/social.css";
fs.readFile(cssFile, "utf-8", (e, data) => {
if (e) return console.log(e);
document.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend", `<style id='custom-css'></style>`);
getID("custom-css").innerHTML = data;
});
window.document.body.insertAdjacentHTML("beforeend", `<div id="hrefprev" style="position:absolute;left:0;bottom:0;height:15px;background-color:#fff;z-index:9999;font-family:sans-serif;font-size: 12px;line-height:15px;padding-left:5px;padding-right:5px"></div>`)
let hrefprev = getID("hrefprev");
window.addEventListener("mousemove", e => { hrefprev.innerHTML = e.target?.href || "" });
window.addEventListener("mousedown", e => {
if(e.button == 2 && e.target.href && !e.target.disabled) {
e.preventDefault();
window.location.href = e.target.href;
}
});
});