mirror of
https://github.com/smartfrigde/armcord.git
synced 2024-08-14 23:56:58 +00:00
Check if user is online
This commit is contained in:
parent
15eb2f867f
commit
5e57963192
2 changed files with 22 additions and 2 deletions
22
index.html
22
index.html
|
@ -63,5 +63,25 @@
|
||||||
<source src="https://discord.com/assets/0bdc0497eb3a19e66f2b1e3d5741634c.webm" type="video/webm">
|
<source src="https://discord.com/assets/0bdc0497eb3a19e66f2b1e3d5741634c.webm" type="video/webm">
|
||||||
</video>
|
</video>
|
||||||
</body>
|
</body>
|
||||||
|
<p id=checkOnline></p>
|
||||||
|
<script>
|
||||||
|
var ifConnected = window.navigator.onLine;
|
||||||
|
if (ifConnected) {
|
||||||
|
document.getElementById("checkOnline").innerHTML = "🟢Online";
|
||||||
|
document.getElementById("checkOnline").style.color = "green";
|
||||||
|
} else {
|
||||||
|
document.getElementById("checkOnline").innerHTML = "🔴 Check your internet connection!";
|
||||||
|
document.getElementById("checkOnline").style.color = "red";
|
||||||
|
}
|
||||||
|
setInterval(function(){
|
||||||
|
var ifConnected = window.navigator.onLine;
|
||||||
|
if (ifConnected) {
|
||||||
|
document.getElementById("checkOnline").innerHTML = "🟢Online";
|
||||||
|
document.getElementById("checkOnline").style.color = "green";
|
||||||
|
} else {
|
||||||
|
document.getElementById("checkOnline").innerHTML = "🔴 Check your internet connection!";
|
||||||
|
document.getElementById("checkOnline").style.color = "red";
|
||||||
|
}
|
||||||
|
}, 3000);
|
||||||
|
</script>
|
||||||
</html>
|
</html>
|
2
main.js
2
main.js
|
@ -40,7 +40,7 @@ app.whenReady().then(() => {
|
||||||
session
|
session
|
||||||
.fromPartition("some-partition")
|
.fromPartition("some-partition")
|
||||||
.setPermissionRequestHandler((webContents, permission, callback) => {
|
.setPermissionRequestHandler((webContents, permission, callback) => {
|
||||||
const url = webContents.getURL();
|
const url = webContents.getURL(); //unused?
|
||||||
|
|
||||||
if (permission === "notifications") {
|
if (permission === "notifications") {
|
||||||
// Approves the permissions request
|
// Approves the permissions request
|
||||||
|
|
Loading…
Reference in a new issue