mirror of
https://github.com/agam778/MS-365-Electron.git
synced 2026-02-17 09:02:10 +00:00
Compare commits
84 Commits
v2.0.0
...
renovate/p
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ff6def9da | ||
|
|
d293b80829 | ||
|
|
975265dd02 | ||
|
|
4c78fdb40c | ||
|
|
ad4a55c8ec | ||
|
|
076764c692 | ||
|
|
a8b27d1374 | ||
|
|
3d1ebf20a4 | ||
|
|
7f5f9efd96 | ||
|
|
b25735efc4 | ||
|
|
d54ea55b7c | ||
|
|
4a20ffa428 | ||
|
|
1e125f0639 | ||
|
|
56a0ce9867 | ||
|
|
a512def03c | ||
|
|
911f9494de | ||
|
|
78531e1223 | ||
|
|
ef3df90c36 | ||
|
|
f91e52a9ba | ||
|
|
d0f7c484ec | ||
|
|
c81c2c4767 | ||
|
|
f2d65bfc7a | ||
|
|
7ccf303d43 | ||
|
|
6b0431f435 | ||
|
|
17c320e185 | ||
|
|
e592d94ff7 | ||
|
|
1067c8611f | ||
|
|
7854c45c59 | ||
|
|
67bea6101b | ||
|
|
5d81b725af | ||
|
|
8e4ccf4670 | ||
|
|
9b56ef4903 | ||
|
|
c195ebbe75 | ||
|
|
479893e5b4 | ||
|
|
dd98d975b8 | ||
|
|
52b4c4513a | ||
|
|
9fb83b8b00 | ||
|
|
71c4146679 | ||
|
|
7fe0ea5fc4 | ||
|
|
9f89a9f0b8 | ||
|
|
8b7a804784 | ||
|
|
650d9e6c9d | ||
|
|
388a4ca247 | ||
|
|
60847f12fe | ||
|
|
d2490fbc52 | ||
|
|
78a8a3b969 | ||
|
|
8c6aa9f5fa | ||
|
|
360c874e5d | ||
|
|
a0cb6259ae | ||
|
|
fd7d61b291 | ||
|
|
c2c91002d2 | ||
|
|
0066e6c5d0 | ||
|
|
aa1e367521 | ||
|
|
33498611cf | ||
|
|
ff2eb6800a | ||
|
|
fac66cce16 | ||
|
|
eb526c4ec9 | ||
|
|
eb10d3def9 | ||
|
|
b8f4a5eba5 | ||
|
|
9a9af15e2e | ||
|
|
c4e72a6e47 | ||
|
|
dc5b3c86d5 | ||
|
|
67d61a4cc9 | ||
|
|
ffc3042053 | ||
|
|
1068ed3a55 | ||
|
|
55d3e94cf9 | ||
|
|
e2abaca1e8 | ||
|
|
675deb3bbf | ||
|
|
f6cf3d92bf | ||
|
|
7a3f3c28df | ||
|
|
abbab926fe | ||
|
|
35f8bbdcd3 | ||
|
|
3c96dd5d12 | ||
|
|
8310966216 | ||
|
|
795ddb6e30 | ||
|
|
4c9e57a6d4 | ||
|
|
a9ce64c986 | ||
|
|
265a33f2a8 | ||
|
|
70cce42bd3 | ||
|
|
667d5e4422 | ||
|
|
338ecea70d | ||
|
|
295f189a8f | ||
|
|
fda67cccd4 | ||
|
|
9774c4f4f7 |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
|
||||
- name: Install Node.js, NPM and Yarn
|
||||
uses: actions/setup-node@v4
|
||||
|
||||
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
|
||||
- name: Install Node.js, NPM and Yarn
|
||||
uses: actions/setup-node@v4
|
||||
|
||||
10
.vscode/settings.json
vendored
Normal file
10
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
|
||||
"editor.formatOnType": false,
|
||||
"editor.formatOnPaste": true,
|
||||
"editor.formatOnSave": true,
|
||||
"editor.formatOnSaveMode": "file",
|
||||
"files.autoSave": "onFocusChange",
|
||||
"prettier.printWidth": 100,
|
||||
"vs-code-prettier-eslint.prettierLast": false
|
||||
}
|
||||
894
.yarn/releases/yarn-4.2.1.cjs
vendored
894
.yarn/releases/yarn-4.2.1.cjs
vendored
File diff suppressed because one or more lines are too long
935
.yarn/releases/yarn-4.7.0.cjs
vendored
Executable file
935
.yarn/releases/yarn-4.7.0.cjs
vendored
Executable file
File diff suppressed because one or more lines are too long
@@ -1,3 +1,3 @@
|
||||
nodeLinker: node-modules
|
||||
|
||||
yarnPath: .yarn/releases/yarn-4.2.1.cjs
|
||||
yarnPath: .yarn/releases/yarn-4.7.0.cjs
|
||||
|
||||
14
app/config/dimensions.js
Normal file
14
app/config/dimensions.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import { app, screen } from "electron";
|
||||
let screenWidth, screenHeight;
|
||||
|
||||
app.on("ready", () => {
|
||||
({ width: screenWidth, height: screenHeight } = screen.getPrimaryDisplay().workAreaSize);
|
||||
});
|
||||
|
||||
export function getScreenWidth() {
|
||||
return screenWidth;
|
||||
}
|
||||
|
||||
export function getScreenHeight() {
|
||||
return screenHeight;
|
||||
}
|
||||
1026
app/config/menu.js
Normal file
1026
app/config/menu.js
Normal file
File diff suppressed because it is too large
Load Diff
41
app/config/store.js
Normal file
41
app/config/store.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import useragents from "../useragents.json" with { type: "json" };
|
||||
import Store from "electron-store";
|
||||
|
||||
const store = new Store();
|
||||
|
||||
export function getValue(key) {
|
||||
return store.get(key);
|
||||
}
|
||||
|
||||
export function setValue(key, value) {
|
||||
store.set(key, value);
|
||||
}
|
||||
|
||||
export function getValueOrDefault(key, defaultValue) {
|
||||
const value = store.get(key);
|
||||
if (value === undefined) {
|
||||
store.set(key, defaultValue);
|
||||
return defaultValue;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
getValueOrDefault("enterprise-or-normal", "?auth=1");
|
||||
getValueOrDefault("websites-in-new-window", "true");
|
||||
getValueOrDefault("autohide-menubar", "false");
|
||||
getValueOrDefault("useragentstring", useragents.Windows);
|
||||
getValueOrDefault("discordrpcstatus", "false");
|
||||
getValueOrDefault("blockadsandtrackers", "false");
|
||||
getValueOrDefault("dynamicicons", "true");
|
||||
getValueOrDefault("autoupdater", "true");
|
||||
getValueOrDefault("custompage", "home");
|
||||
getValueOrDefault("windowWidth", 0.71);
|
||||
getValueOrDefault("windowHeight", 0.74);
|
||||
getValueOrDefault("customWindowSize", false);
|
||||
getValueOrDefault("externalLinks", "true");
|
||||
|
||||
if (getValue("enterprise-or-normal") === "https://microsoft365.com/?auth=1") {
|
||||
setValue("enterprise-or-normal", "?auth=1");
|
||||
} else if (getValue("enterprise-or-normal") === "https://microsoft365.com/?auth=2") {
|
||||
setValue("enterprise-or-normal", "?auth=2");
|
||||
}
|
||||
82
app/config/utils.js
Normal file
82
app/config/utils.js
Normal file
@@ -0,0 +1,82 @@
|
||||
import { app, dialog, shell } from "electron";
|
||||
import axios from "axios";
|
||||
import { setValue } from "./store.js";
|
||||
import updaterpkg from "electron-updater";
|
||||
|
||||
const { autoUpdater } = updaterpkg;
|
||||
|
||||
export async function checkForUpdates() {
|
||||
try {
|
||||
const res = await axios.get(
|
||||
"https://api.github.com/repos/agam778/MS-365-Electron/releases/latest"
|
||||
);
|
||||
const data = res.data;
|
||||
const currentVersion = "v" + app.getVersion();
|
||||
const latestVersion = data.tag_name;
|
||||
|
||||
if (currentVersion !== latestVersion) {
|
||||
if (process.platform === "win32" || process.platform === "darwin") {
|
||||
autoUpdater.checkForUpdatesAndNotify().then((result) => {
|
||||
if (result === null) {
|
||||
dialog.showMessageBoxSync({
|
||||
type: "info",
|
||||
title: "No Update Available",
|
||||
message: `Current version: ${currentVersion}\nLatest version: ${latestVersion}\n\nYou are already using the latest version.`,
|
||||
buttons: ["OK"],
|
||||
});
|
||||
}
|
||||
});
|
||||
return;
|
||||
} else {
|
||||
const updatedialog = dialog.showMessageBoxSync({
|
||||
type: "info",
|
||||
title: "Update Available",
|
||||
message: `Current version: ${currentVersion}\nLatest version: ${latestVersion}\n\nPlease update to the latest version.`,
|
||||
buttons: ["Download", "Close"],
|
||||
});
|
||||
if (updatedialog === 0) {
|
||||
shell.openExternal("https://github.com/agam778/MS-365-Electron/releases/latest");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dialog.showMessageBoxSync({
|
||||
type: "info",
|
||||
title: "No Update Available",
|
||||
message: `Your App's version: ${currentVersion}\nLatest version: ${latestVersion}\n\nYou are already using the latest version.`,
|
||||
buttons: ["OK"],
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error checking for updates:", error);
|
||||
}
|
||||
}
|
||||
|
||||
export async function openExternalLink(url) {
|
||||
await shell.openExternal(url);
|
||||
}
|
||||
|
||||
export async function openLogsFolder() {
|
||||
if (process.platform === "win32") {
|
||||
await shell.openPath(
|
||||
"C:\\Users\\" + process.env.USERNAME + "\\AppData\\Roaming\\ms-365-electron\\logs\\"
|
||||
);
|
||||
} else if (process.platform === "darwin") {
|
||||
await shell.openPath("/Users/" + process.env.USER + "/Library/Logs/ms-365-electron/");
|
||||
} else if (process.platform === "linux") {
|
||||
await shell.openPath("/home/" + process.env.USER + "/.config/ms-365-electron/logs/");
|
||||
}
|
||||
}
|
||||
|
||||
export function setUserAgent(useragent) {
|
||||
setValue("useragentstring", useragent);
|
||||
const updatedialog = dialog.showMessageBoxSync({
|
||||
type: "info",
|
||||
title: "User-Agent string changed",
|
||||
message: `You have switched to the ${useragent} User-Agent string.\n\nPlease restart the app for the changes to take effect.`,
|
||||
buttons: ["Later", "Restart"],
|
||||
});
|
||||
if (updatedialog === 1) {
|
||||
app.relaunch();
|
||||
app.exit();
|
||||
}
|
||||
}
|
||||
125
app/domains.json
Normal file
125
app/domains.json
Normal file
@@ -0,0 +1,125 @@
|
||||
{
|
||||
"domains": [
|
||||
"*.1drv.ms",
|
||||
"*.microsoft365.com",
|
||||
"*.office365.com",
|
||||
"*.live.com",
|
||||
"*.office.com",
|
||||
"*.microsoftonline.com",
|
||||
"*.onenote.com",
|
||||
"*.onedrive.com",
|
||||
"*.outlook.com",
|
||||
"*.microsoft.com",
|
||||
"*.cloud.microsoft",
|
||||
"*.skype.com",
|
||||
"*.clipchamp.com",
|
||||
"*.sharepoint.com",
|
||||
"*.yammer.com",
|
||||
"*.outlook.cloud.microsoft",
|
||||
"*.outlook.office.com",
|
||||
"*.outlook.office365.com",
|
||||
"*.protection.outlook.com",
|
||||
"*.mail.protection.outlook.com",
|
||||
"*.mx.microsoft",
|
||||
"*.sharepointonline.com",
|
||||
"*.storage.live.com",
|
||||
"*.search.production.apac.trafficmanager.net",
|
||||
"*.search.production.emea.trafficmanager.net",
|
||||
"*.search.production.us.trafficmanager.net",
|
||||
"*.wns.windows.com",
|
||||
"*.admin.onedrive.com",
|
||||
"*.officeclient.microsoft.com",
|
||||
"*.g.live.com",
|
||||
"*.oneclient.sfx.ms",
|
||||
"*.spoprod-a.akamaihd.net",
|
||||
"*.svc.ms",
|
||||
"*.teams.microsoft.com",
|
||||
"*.lync.com",
|
||||
"*.keydelivery.mediaservices.windows.net",
|
||||
"*.streaming.mediaservices.windows.net",
|
||||
"*.mlccdn.blob.core.windows.net",
|
||||
"*.aka.ms",
|
||||
"*.users.storage.live.com",
|
||||
"*.adl.windows.com",
|
||||
"*.secure.skypeassets.com",
|
||||
"*.mlccdnprod.azureedge.net",
|
||||
"*.skype.com",
|
||||
"*.compass-ssl.microsoft.com",
|
||||
"*.officeapps.live.com",
|
||||
"*.online.office.com",
|
||||
"*.office.live.com",
|
||||
"*.office.net",
|
||||
"*.onenote.com",
|
||||
"*.cdn.onenote.net",
|
||||
"*.ajax.aspnetcdn.com",
|
||||
"*.apis.live.net",
|
||||
"*.www.onedrive.com",
|
||||
"*.auth.microsoft.com",
|
||||
"*.msftidentity.com",
|
||||
"*.msidentity.com",
|
||||
"*.account.activedirectory.windowsazure.com",
|
||||
"*.accounts.accesscontrol.windows.net",
|
||||
"*.adminwebservice.microsoftonline.com",
|
||||
"*.api.passwordreset.microsoftonline.com",
|
||||
"*.autologon.microsoftazuread-sso.com",
|
||||
"*.becws.microsoftonline.com",
|
||||
"*.ccs.login.microsoftonline.com",
|
||||
"*.clientconfig.microsoftonline-p.net",
|
||||
"*.companymanager.microsoftonline.com",
|
||||
"*.device.login.microsoftonline.com",
|
||||
"*.graph.microsoft.com",
|
||||
"*.graph.windows.net",
|
||||
"*.login-us.microsoftonline.com",
|
||||
"*.login.microsoft.com",
|
||||
"*.login.microsoftonline-p.com",
|
||||
"*.login.microsoftonline.com",
|
||||
"*.login.windows.net",
|
||||
"*.logincert.microsoftonline.com",
|
||||
"*.loginex.microsoftonline.com",
|
||||
"*.nexus.microsoftonline-p.com",
|
||||
"*.passwordreset.microsoftonline.com",
|
||||
"*.provisioningapi.microsoftonline.com",
|
||||
"*.hip.live.com",
|
||||
"*.microsoftonline-p.com",
|
||||
"*.msauth.net",
|
||||
"*.msauthimages.net",
|
||||
"*.msecnd.net",
|
||||
"*.msftauth.net",
|
||||
"*.msftauthimages.net",
|
||||
"*.phonefactor.net",
|
||||
"*.enterpriseregistration.windows.net",
|
||||
"*.policykeyservice.dc.ad.msft.net",
|
||||
"*.sharepointonline.com",
|
||||
"*.staffhub.ms",
|
||||
"*.staffhubweb.azureedge.net",
|
||||
"*.sway.com",
|
||||
"*.www.sway.com",
|
||||
"*.eus-www.sway-cdn.com",
|
||||
"*.eus-www.sway-extensions.com",
|
||||
"*.wus-www.sway-cdn.com",
|
||||
"*.wus-www.sway-extensions.com",
|
||||
"*.microsoftusercontent.com",
|
||||
"*.azure-apim.net",
|
||||
"*.flow.microsoft.com",
|
||||
"*.powerapps.com",
|
||||
"*.powerautomate.com",
|
||||
"*.activity.windows.com",
|
||||
"*.cortana.ai",
|
||||
"*.admin.microsoft.com",
|
||||
"*.cdn.odc.officeapps.live.com",
|
||||
"*.cdn.uci.officeapps.live.com",
|
||||
"*.cloud.microsoft",
|
||||
"*.static.microsoft",
|
||||
"*.usercontent.microsoft",
|
||||
"*.compliance.microsoft.com",
|
||||
"*.protection.office.com",
|
||||
"*.security.microsoft.com",
|
||||
"*.defender.microsoft.com",
|
||||
"*.blob.core.windows.net",
|
||||
"*.firstpartyapps.oaspapps.com",
|
||||
"*.prod.firstpartyapps.oaspapps.com.akadns.net",
|
||||
"*.telemetryservice.firstpartyapps.oaspapps.com",
|
||||
"*.wus-firstpartyapps.oaspapps.com"
|
||||
],
|
||||
"source": "https://learn.microsoft.com/en-us/microsoft-365/enterprise/urls-and-ip-address-ranges?view=o365-worldwide"
|
||||
}
|
||||
216
app/main.js
216
app/main.js
@@ -1,22 +1,24 @@
|
||||
import { app, Menu, BrowserWindow, dialog, nativeImage } from "electron";
|
||||
import { clearActivity, setActivity, loginToRPC } from './rpc.js';
|
||||
import { initialize, trackEvent } from "@aptabase/electron/main";
|
||||
import { app, Menu, BrowserWindow, dialog, nativeImage, shell } from "electron";
|
||||
import { clearActivity, setActivity, loginToRPC } from "./config/rpc.js";
|
||||
import { ElectronBlocker } from "@cliqz/adblocker-electron";
|
||||
import { getValue } from './store.js';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { dirname } from 'path';
|
||||
import { join } from "path";
|
||||
import { setValue, getValue } from "./config/store.js";
|
||||
import { dirname, join } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
import { getScreenWidth, getScreenHeight } from "./config/dimensions.js";
|
||||
import Windows from "./useragents.json" with { type: "json" };
|
||||
import checkInternetConnected from "check-internet-connected";
|
||||
import domains from "./domains.json" with { type: "json" };
|
||||
import contextMenu from "electron-context-menu";
|
||||
import updaterpkg from "electron-updater";
|
||||
import ElectronDl from "electron-dl";
|
||||
import menulayout from './menu.js'
|
||||
import logpkg from 'electron-log';
|
||||
import menulayout from "./config/menu.js";
|
||||
import logpkg from "electron-log";
|
||||
|
||||
const { transports, log: _log, functions } = logpkg;
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const windowHeight = getValue("windowHeight");
|
||||
const windowWidth = getValue("windowWidth");
|
||||
const __dirname = dirname(__filename);
|
||||
const { autoUpdater } = updaterpkg;
|
||||
|
||||
@@ -24,16 +26,14 @@ transports.file.level = "verbose";
|
||||
console.log = _log;
|
||||
Object.assign(console, functions);
|
||||
|
||||
initialize("A-US-2528580917");
|
||||
|
||||
function createWindow() {
|
||||
const enterpriseOrNormal = getValue("enterprise-or-normal");
|
||||
const custompage = getValue("custompage");
|
||||
const partition = enterpriseOrNormal === "?auth=1" ? "persist:personal" : "persist:work";
|
||||
|
||||
|
||||
const win = new BrowserWindow({
|
||||
width: 1181,
|
||||
height: 670,
|
||||
width: Math.round(getScreenWidth() * getValue("windowWidth")),
|
||||
height: Math.round(getScreenHeight() * getValue("windowHeight")),
|
||||
icon: join(__dirname, "/assets/icons/png/1024x1024.png"),
|
||||
show: false,
|
||||
webPreferences: {
|
||||
@@ -41,13 +41,13 @@ function createWindow() {
|
||||
devTools: true,
|
||||
partition: partition,
|
||||
},
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
win.setAutoHideMenuBar(getValue("autohide-menubar") === "true");
|
||||
|
||||
const splash = new BrowserWindow({
|
||||
width: 810,
|
||||
height: 610,
|
||||
width: Math.round(getScreenWidth() * 0.49),
|
||||
height: Math.round(getScreenHeight() * 0.65),
|
||||
transparent: true,
|
||||
frame: false,
|
||||
icon: join(__dirname, "/assets/icons/png/1024x1024.png"),
|
||||
@@ -62,7 +62,6 @@ function createWindow() {
|
||||
win.webContents.on("did-finish-load", () => {
|
||||
splash.destroy();
|
||||
win.show();
|
||||
trackEvent("app_started");
|
||||
if (getValue("discordrpcstatus") === "true") {
|
||||
setActivity(`On "${win.webContents.getTitle()}"`);
|
||||
}
|
||||
@@ -115,46 +114,74 @@ app.on("ready", () => {
|
||||
|
||||
app.on("web-contents-created", (event, contents) => {
|
||||
contents.setWindowOpenHandler(({ url }) => {
|
||||
if (getValue("websites-in-new-window") === "false") {
|
||||
if (url.includes("page=Download")) {
|
||||
return { action: "allow" };
|
||||
} else {
|
||||
BrowserWindow.getFocusedWindow()
|
||||
.loadURL(url)
|
||||
.catch((err) => {
|
||||
// do not show error
|
||||
});
|
||||
if (getValue("discordrpcstatus") === "true") {
|
||||
setActivity(
|
||||
`On "${BrowserWindow.getFocusedWindow().webContents.getTitle()}"`
|
||||
);
|
||||
const urlObject = new URL(url);
|
||||
const domain = urlObject.hostname;
|
||||
const protocol = urlObject.protocol;
|
||||
|
||||
if (getValue("externalLinks") === "true") {
|
||||
if (protocol === "http:" || protocol === "https:") {
|
||||
const isAllowedDomain = domains.domains.some((allowedDomain) =>
|
||||
new RegExp(`^${allowedDomain.replace("*.", ".*")}$`).test(domain)
|
||||
);
|
||||
|
||||
if (isAllowedDomain) {
|
||||
if (getValue("websites-in-new-window") === "false") {
|
||||
if (url.includes("page=Download")) return { action: "allow" };
|
||||
BrowserWindow.getFocusedWindow().loadURL(url).catch();
|
||||
if (getValue("discordrpcstatus") === "true") {
|
||||
setActivity(`On "${BrowserWindow.getFocusedWindow().webContents.getTitle()}"`);
|
||||
}
|
||||
return { action: "deny" };
|
||||
} else {
|
||||
if (getValue("discordrpcstatus") === "true") {
|
||||
setActivity(`On "${BrowserWindow.getFocusedWindow().webContents.getTitle()}"`);
|
||||
}
|
||||
return {
|
||||
action: "allow",
|
||||
overrideBrowserWindowOptions: {
|
||||
width: Math.round(getScreenWidth() * (windowWidth - 0.07)),
|
||||
height: Math.round(getScreenHeight() * (windowHeight - 0.07)),
|
||||
},
|
||||
};
|
||||
}
|
||||
} else {
|
||||
shell.openExternal(url);
|
||||
return { action: "deny" };
|
||||
}
|
||||
} else {
|
||||
return { action: "deny" };
|
||||
}
|
||||
} else {
|
||||
if (getValue("discordrpcstatus") === "true") {
|
||||
setActivity(
|
||||
`On "${BrowserWindow.getFocusedWindow().webContents.getTitle()}"`
|
||||
);
|
||||
if (getValue("websites-in-new-window") === "false") {
|
||||
if (url.includes("page=Download")) return { action: "allow" };
|
||||
BrowserWindow.getFocusedWindow().loadURL(url).catch();
|
||||
if (getValue("discordrpcstatus") === "true") {
|
||||
setActivity(`On "${BrowserWindow.getFocusedWindow().webContents.getTitle()}"`);
|
||||
}
|
||||
return { action: "deny" };
|
||||
} else {
|
||||
if (getValue("discordrpcstatus") === "true") {
|
||||
setActivity(`On "${BrowserWindow.getFocusedWindow().webContents.getTitle()}"`);
|
||||
}
|
||||
return {
|
||||
action: "allow",
|
||||
overrideBrowserWindowOptions: {
|
||||
width: Math.round(getScreenWidth() * (windowWidth - 0.07)),
|
||||
height: Math.round(getScreenHeight() * (windowHeight - 0.07)),
|
||||
},
|
||||
};
|
||||
}
|
||||
return { action: "allow", overrideBrowserWindowOptions: { width: 1081, height: 610 } };
|
||||
}
|
||||
});
|
||||
contents.on("did-finish-load", () => {
|
||||
if (getValue("dynamicicons") === "true") {
|
||||
if (BrowserWindow.getFocusedWindow()) {
|
||||
if (
|
||||
BrowserWindow.getFocusedWindow()
|
||||
.webContents.getURL()
|
||||
.includes("&ithint=file%2cpptx") ||
|
||||
BrowserWindow.getFocusedWindow()
|
||||
.webContents.getTitle()
|
||||
.includes(".pptx")
|
||||
BrowserWindow.getFocusedWindow().webContents.getURL().includes("&ithint=file%2cpptx") ||
|
||||
BrowserWindow.getFocusedWindow().webContents.getTitle().includes(".pptx")
|
||||
) {
|
||||
if (process.platform === "darwin") {
|
||||
app.dock.setIcon(
|
||||
join(__dirname, "../assets/icons/apps/powerpoint-mac.png")
|
||||
);
|
||||
app.dock.setIcon(join(__dirname, "../assets/icons/apps/powerpoint-mac.png"));
|
||||
} else if (process.platform === "win32") {
|
||||
let nimage = nativeImage.createFromPath(
|
||||
join(__dirname, "../assets/icons/apps/powerpoint.png")
|
||||
@@ -164,17 +191,11 @@ app.on("web-contents-created", (event, contents) => {
|
||||
});
|
||||
}
|
||||
} else if (
|
||||
BrowserWindow.getFocusedWindow()
|
||||
.webContents.getURL()
|
||||
.includes("&ithint=file%2cdocx") ||
|
||||
BrowserWindow.getFocusedWindow()
|
||||
.webContents.getTitle()
|
||||
.includes(".docx")
|
||||
BrowserWindow.getFocusedWindow().webContents.getURL().includes("&ithint=file%2cdocx") ||
|
||||
BrowserWindow.getFocusedWindow().webContents.getTitle().includes(".docx")
|
||||
) {
|
||||
if (process.platform === "darwin") {
|
||||
app.dock.setIcon(
|
||||
join(__dirname, "../assets/icons/apps/word-mac.png")
|
||||
);
|
||||
app.dock.setIcon(join(__dirname, "../assets/icons/apps/word-mac.png"));
|
||||
} else if (process.platform === "win32") {
|
||||
let nimage = nativeImage.createFromPath(
|
||||
join(__dirname, "../assets/icons/apps/word.png")
|
||||
@@ -184,17 +205,11 @@ app.on("web-contents-created", (event, contents) => {
|
||||
});
|
||||
}
|
||||
} else if (
|
||||
BrowserWindow.getFocusedWindow()
|
||||
.webContents.getURL()
|
||||
.includes("&ithint=file%2cxlsx") ||
|
||||
BrowserWindow.getFocusedWindow()
|
||||
.webContents.getTitle()
|
||||
.includes(".xlsx")
|
||||
BrowserWindow.getFocusedWindow().webContents.getURL().includes("&ithint=file%2cxlsx") ||
|
||||
BrowserWindow.getFocusedWindow().webContents.getTitle().includes(".xlsx")
|
||||
) {
|
||||
if (process.platform === "darwin") {
|
||||
app.dock.setIcon(
|
||||
join(__dirname, "../assets/icons/apps/excel-mac.png")
|
||||
);
|
||||
app.dock.setIcon(join(__dirname, "../assets/icons/apps/excel-mac.png"));
|
||||
} else if (process.platform === "win32") {
|
||||
let nimage = nativeImage.createFromPath(
|
||||
join(__dirname, "../assets/icons/apps/excel.png")
|
||||
@@ -204,17 +219,11 @@ app.on("web-contents-created", (event, contents) => {
|
||||
});
|
||||
}
|
||||
} else if (
|
||||
BrowserWindow.getFocusedWindow()
|
||||
.webContents.getURL()
|
||||
.includes("outlook.live.com") ||
|
||||
BrowserWindow.getFocusedWindow()
|
||||
.webContents.getURL()
|
||||
.includes("outlook.office.com")
|
||||
BrowserWindow.getFocusedWindow().webContents.getURL().includes("outlook.live.com") ||
|
||||
BrowserWindow.getFocusedWindow().webContents.getURL().includes("outlook.office.com")
|
||||
) {
|
||||
if (process.platform === "darwin") {
|
||||
app.dock.setIcon(
|
||||
join(__dirname, "../assets/icons/apps/outlook-mac.png")
|
||||
);
|
||||
app.dock.setIcon(join(__dirname, "../assets/icons/apps/outlook-mac.png"));
|
||||
} else if (process.platform === "win32") {
|
||||
let nimage = nativeImage.createFromPath(
|
||||
join(__dirname, "../assets/icons/apps/outlook.png")
|
||||
@@ -224,17 +233,11 @@ app.on("web-contents-created", (event, contents) => {
|
||||
});
|
||||
}
|
||||
} else if (
|
||||
BrowserWindow.getFocusedWindow()
|
||||
.webContents.getURL()
|
||||
.includes("onedrive.live.com") ||
|
||||
BrowserWindow.getFocusedWindow()
|
||||
.webContents.getURL()
|
||||
.includes("onedrive.aspx")
|
||||
BrowserWindow.getFocusedWindow().webContents.getURL().includes("onedrive.live.com") ||
|
||||
BrowserWindow.getFocusedWindow().webContents.getURL().includes("onedrive.aspx")
|
||||
) {
|
||||
if (process.platform === "darwin") {
|
||||
app.dock.setIcon(
|
||||
join(__dirname, "../assets/icons/apps/onedrive-mac.png")
|
||||
);
|
||||
app.dock.setIcon(join(__dirname, "../assets/icons/apps/onedrive-mac.png"));
|
||||
} else if (process.platform === "win32") {
|
||||
let nimage = nativeImage.createFromPath(
|
||||
join(__dirname, "../assets/icons/apps/onedrive.png")
|
||||
@@ -244,14 +247,10 @@ app.on("web-contents-created", (event, contents) => {
|
||||
});
|
||||
}
|
||||
} else if (
|
||||
BrowserWindow.getFocusedWindow()
|
||||
.webContents.getURL()
|
||||
.includes("teams.live.com")
|
||||
BrowserWindow.getFocusedWindow().webContents.getURL().includes("teams.live.com")
|
||||
) {
|
||||
if (process.platform === "darwin") {
|
||||
app.dock.setIcon(
|
||||
join(__dirname, "../assets/icons/apps/teams-mac.png")
|
||||
);
|
||||
app.dock.setIcon(join(__dirname, "../assets/icons/apps/teams-mac.png"));
|
||||
} else if (process.platform === "win32") {
|
||||
let nimage = nativeImage.createFromPath(
|
||||
join(__dirname, "../assets/icons/apps/teams.png")
|
||||
@@ -261,14 +260,10 @@ app.on("web-contents-created", (event, contents) => {
|
||||
});
|
||||
}
|
||||
} else if (
|
||||
BrowserWindow.getFocusedWindow()
|
||||
.webContents.getURL()
|
||||
.includes("&ithint=onenote")
|
||||
BrowserWindow.getFocusedWindow().webContents.getURL().includes("&ithint=onenote")
|
||||
) {
|
||||
if (process.platform === "darwin") {
|
||||
app.dock.setIcon(
|
||||
join(__dirname, "../assets/icons/apps/onenote-mac.png")
|
||||
);
|
||||
app.dock.setIcon(join(__dirname, "../assets/icons/apps/onenote-mac.png"));
|
||||
} else if (process.platform === "win32") {
|
||||
let nimage = nativeImage.createFromPath(
|
||||
join(__dirname, "../assets/icons/apps/onenote.png")
|
||||
@@ -288,6 +283,39 @@ app.on("web-contents-created", (event, contents) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
BrowserWindow.getAllWindows().forEach((window) => {
|
||||
if (window.webContents.getURL().includes("outlook.live.com")) {
|
||||
window.webContents
|
||||
.executeJavaScript(
|
||||
`
|
||||
const observer = new MutationObserver((mutationsList) => {
|
||||
let adElementFound = false;
|
||||
for (const mutation of mutationsList) {
|
||||
if (mutation.type === 'childList') {
|
||||
const adElement = document.querySelector('div.GssDD');
|
||||
if (adElement) {
|
||||
adElement.remove();
|
||||
adElementFound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (adElementFound) {
|
||||
observer.disconnect();
|
||||
}
|
||||
});
|
||||
|
||||
observer.observe(document.body, { childList: true, subtree: true });
|
||||
|
||||
const adElement = document.querySelector('div.GssDD');
|
||||
if (adElement) {
|
||||
adElement.remove();
|
||||
observer.disconnect();
|
||||
}
|
||||
`
|
||||
)
|
||||
.catch();
|
||||
}
|
||||
});
|
||||
contents.insertCSS(
|
||||
`
|
||||
::-webkit-scrollbar {
|
||||
|
||||
1375
app/menu.js
1375
app/menu.js
File diff suppressed because it is too large
Load Diff
19
app/store.js
19
app/store.js
@@ -1,19 +0,0 @@
|
||||
import Store from "electron-store";
|
||||
const store = new Store();
|
||||
|
||||
export function getValue(key) {
|
||||
return store.get(key);
|
||||
}
|
||||
|
||||
export function setValue(key, value) {
|
||||
store.set(key, value);
|
||||
}
|
||||
|
||||
export function getValueOrDefault(key, defaultValue) {
|
||||
const value = store.get(key);
|
||||
if (value === undefined) {
|
||||
store.set(key, defaultValue);
|
||||
return defaultValue;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
210
docs/index.css
210
docs/index.css
@@ -5,6 +5,12 @@ body {
|
||||
background-size: auto;
|
||||
background-repeat: no-repeat;
|
||||
background-attachment: fixed;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
@@ -19,16 +25,55 @@ body {
|
||||
--font-size-sm: 14px;
|
||||
--color-aliceblue-100: #f3f8ff;
|
||||
--br-5xs: 8px;
|
||||
--color-download: #00a7ff;
|
||||
--color-github: #333;
|
||||
}
|
||||
|
||||
.download-now {
|
||||
position: relative;
|
||||
font-size: var(--font-size-sm);
|
||||
line-height: 19px;
|
||||
font-weight: 600;
|
||||
.container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: row;
|
||||
width: 100%;
|
||||
max-width: 1200px;
|
||||
padding: 20px;
|
||||
font-family: var(--font-poppins);
|
||||
color: var(--color-aliceblue-100);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ms-365-electron {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
width: 50%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.heading {
|
||||
font-size: 85px;
|
||||
line-height: 90px;
|
||||
color: #292e37;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.byagam778 {
|
||||
font-size: 38px;
|
||||
line-height: 50px;
|
||||
font-family: 'SF Pro Text',-apple-system,BlinkMacSystemFont,var(--font-san-francisco);
|
||||
color: #00acff;
|
||||
cursor: pointer;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.description {
|
||||
font-size: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.buttons {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.download,
|
||||
@@ -37,155 +82,100 @@ body {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
background-color: transparent;
|
||||
position: absolute;
|
||||
margin-top: 597px;
|
||||
border-radius: var(--br-5xs);
|
||||
width: 190px;
|
||||
height: 62px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all 0.5ms ease;
|
||||
}
|
||||
|
||||
.download {
|
||||
margin-left: 172px;
|
||||
background: linear-gradient(90.05deg, #45bfff 26.58%, #00a7ff);
|
||||
background: linear-gradient(90.05deg, #45bfff 26.58%, var(--color-download));
|
||||
box-shadow: 0 24px 30px -16px rgba(45, 183, 255, 0.25);
|
||||
}
|
||||
|
||||
.github {
|
||||
margin-left: 392px;
|
||||
background: linear-gradient(90.05deg, #424242 26.58%, #333);
|
||||
background: linear-gradient(90.05deg, #424242 26.58%, var(--color-github));
|
||||
box-shadow: 0 24px 30px -16px rgba(66, 66, 66, 0.25);
|
||||
}
|
||||
|
||||
.description,
|
||||
.heading {
|
||||
position: absolute;
|
||||
margin-top: 505px;
|
||||
margin-left: 172px;
|
||||
line-height: 26px;
|
||||
display: inline-block;
|
||||
width: 388px;
|
||||
.download:hover {
|
||||
background: transparent;
|
||||
border: 3px solid var(--color-download);
|
||||
color: black;
|
||||
}
|
||||
|
||||
.heading {
|
||||
margin-top: 285px;
|
||||
margin-left: 166px;
|
||||
font-size: 85px;
|
||||
line-height: 90px;
|
||||
color: #292e37;
|
||||
width: 461px;
|
||||
.github:hover {
|
||||
background: transparent;
|
||||
border: 3px solid var(--color-github);
|
||||
color: black;
|
||||
}
|
||||
|
||||
.byagam778 {
|
||||
position: absolute;
|
||||
margin-top: 219px;
|
||||
margin-left: 170px;
|
||||
font-size: 38px;
|
||||
line-height: 50px;
|
||||
font-family: 'SF Pro Text',-apple-system,BlinkMacSystemFont,var(--font-san-francisco);
|
||||
color: #00acff;
|
||||
cursor: pointer;
|
||||
.download-now {
|
||||
font-size: var(--font-size-sm);
|
||||
line-height: 19px;
|
||||
font-weight: 600;
|
||||
color: var(--color-aliceblue-100);
|
||||
transition: color 0.5s ease;
|
||||
}
|
||||
|
||||
.content,
|
||||
.preview-icon {
|
||||
position: absolute;
|
||||
margin-top: -93px;
|
||||
margin-left: 0;
|
||||
width: 890px;
|
||||
height: 834px;
|
||||
}
|
||||
|
||||
.content {
|
||||
transform: translate(-50%, -50%);
|
||||
margin-left: 30%;
|
||||
margin-top: 21.5%;
|
||||
.download:hover .download-now,
|
||||
.github:hover .download-now {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.preview-icon {
|
||||
position: absolute;
|
||||
margin-top: 23%;
|
||||
margin-left: 68%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 708px;
|
||||
height: 447px;
|
||||
width: 50%;
|
||||
max-width: 708px;
|
||||
height: auto;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.ms-365-electron {
|
||||
width: 100%;
|
||||
height: 696px;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
text-align: left;
|
||||
font-size: 18px;
|
||||
color: #525d73;
|
||||
font-family: var(--font-poppins);
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.preview-icon {
|
||||
width: 78%;
|
||||
height: auto;
|
||||
margin-top: 45%;
|
||||
margin-left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
.container {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-top: 77%;
|
||||
.preview-icon {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.ms-365-electron {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.heading {
|
||||
text-align: center;
|
||||
font-size: 30px;
|
||||
height: auto;
|
||||
margin-top: 56%;
|
||||
margin-left: 59%;
|
||||
transform: translate(-50%, -50%);
|
||||
line-height: 36px;
|
||||
}
|
||||
|
||||
.byagam778 {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
font-size: 26px;
|
||||
height: auto;
|
||||
margin-top: 50%;
|
||||
margin-left: 59%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.description {
|
||||
text-align: center;
|
||||
width: 40%;
|
||||
font-size: 20px;
|
||||
height: auto;
|
||||
margin-top: 65%;
|
||||
margin-left: 59%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.download,
|
||||
.github {
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
margin-top: 85%;
|
||||
margin-left: 59%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.download {
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
margin-top: 77%;
|
||||
margin-left: 59%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 160px;
|
||||
height: 54px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.download-now {
|
||||
font-size: 14px;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.buttons {
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="initial-scale=1, width=device-width" />
|
||||
<title>MS-365-Electron</title>
|
||||
<link rel="stylesheet" href="./index.css" />
|
||||
<link
|
||||
rel="apple-touch-icon"
|
||||
sizes="180x180"
|
||||
href="./favicons/apple-touch-icon.png"
|
||||
/>
|
||||
<link
|
||||
rel="icon"
|
||||
type="image/png"
|
||||
sizes="32x32"
|
||||
href="./favicons/favicon-32x32.png"
|
||||
/>
|
||||
<link
|
||||
rel="icon"
|
||||
type="image/png"
|
||||
sizes="16x16"
|
||||
href="./favicons/favicon-16x16.png"
|
||||
/>
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="./favicons/apple-touch-icon.png" />
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="./favicons/favicon-32x32.png" />
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="./favicons/favicon-16x16.png" />
|
||||
<link rel="manifest" href="./favicons/site.webmanifest" />
|
||||
<link
|
||||
rel="mask-icon"
|
||||
href="./favicons/safari-pinned-tab.svg"
|
||||
color="#5bbad5"
|
||||
/>
|
||||
<link rel="mask-icon" href="./favicons/safari-pinned-tab.svg" color="#5bbad5" />
|
||||
<link rel="shortcut icon" href="./favicons/favicon.ico" />
|
||||
<meta name="apple-mobile-web-app-title" content="MS-365-Electron" />
|
||||
<meta name="application-name" content="MS-365-Electron" />
|
||||
@@ -44,22 +26,24 @@
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="ms-365-electron">
|
||||
<div class="content">
|
||||
<button class="download" id="download">
|
||||
<div class="download-now">
|
||||
Download Now:
|
||||
<div id="release-tag"></div>
|
||||
</div>
|
||||
</button>
|
||||
<button class="github" id="gitHub">
|
||||
<div class="download-now">View on GitHub</div>
|
||||
</button>
|
||||
<div class="container">
|
||||
<div class="ms-365-electron">
|
||||
<div class="byagam778" id="byagam778">By @agam778</div>
|
||||
<div class="heading">MS-365-Electron</div>
|
||||
<div class="description">
|
||||
Unofficial Microsoft 365 Web Desktop Wrapper made with Electron
|
||||
</div>
|
||||
<b class="heading">MS-365-Electron</b>
|
||||
<div class="byagam778" id="byagam778">By @agam778</div>
|
||||
<div class="buttons">
|
||||
<button class="download" id="download">
|
||||
<div class="download-now">
|
||||
Download Now:
|
||||
<div id="release-tag"></div>
|
||||
</div>
|
||||
</button>
|
||||
<button class="github" id="gitHub">
|
||||
<div class="download-now">View on GitHub</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<img class="preview-icon" alt="" src="./public/preview.png" />
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
var c = arguments[b];
|
||||
if (c)
|
||||
for (var d in c)
|
||||
c.hasOwnProperty(d) &&
|
||||
("object" == typeof c[d] ? deepExtend(a[d], c[d]) : (a[d] = c[d]));
|
||||
c.hasOwnProperty(d) && ("object" == typeof c[d] ? deepExtend(a[d], c[d]) : (a[d] = c[d]));
|
||||
}
|
||||
return a;
|
||||
}
|
||||
@@ -29,11 +28,7 @@
|
||||
d.insertBefore(r, d.firstChild),
|
||||
(s = r.getContext("2d")),
|
||||
i();
|
||||
for (
|
||||
var c = Math.round((r.width * r.height) / g.density), e = 0;
|
||||
c > e;
|
||||
e++
|
||||
) {
|
||||
for (var c = Math.round((r.width * r.height) / g.density), e = 0; c > e; e++) {
|
||||
var f = new n();
|
||||
f.setStackPos(e), z.push(f);
|
||||
}
|
||||
@@ -74,9 +69,7 @@
|
||||
}
|
||||
function j() {
|
||||
if (y) {
|
||||
(u = a.innerWidth),
|
||||
(v = a.innerHeight),
|
||||
s.clearRect(0, 0, r.width, r.height);
|
||||
(u = a.innerWidth), (v = a.innerHeight), s.clearRect(0, 0, r.width, r.height);
|
||||
for (var b = 0; b < z.length; b++) z[b].updatePosition();
|
||||
for (var b = 0; b < z.length; b++) z[b].draw();
|
||||
G || (t = requestAnimationFrame(j));
|
||||
@@ -84,11 +77,7 @@
|
||||
}
|
||||
function k() {
|
||||
i();
|
||||
for (
|
||||
var a = d.offsetWidth, b = d.offsetHeight, c = z.length - 1;
|
||||
c >= 0;
|
||||
c--
|
||||
)
|
||||
for (var a = d.offsetWidth, b = d.offsetHeight, c = z.length - 1; c >= 0; c--)
|
||||
(z[c].position.x > a || z[c].position.y > b) && z.splice(c, 1);
|
||||
var e = Math.round((r.width * r.height) / g.density);
|
||||
if (e > z.length)
|
||||
@@ -120,42 +109,24 @@
|
||||
g.directionX)
|
||||
) {
|
||||
case "left":
|
||||
this.speed.x = +(
|
||||
-g.maxSpeedX +
|
||||
Math.random() * g.maxSpeedX -
|
||||
g.minSpeedX
|
||||
).toFixed(2);
|
||||
this.speed.x = +(-g.maxSpeedX + Math.random() * g.maxSpeedX - g.minSpeedX).toFixed(2);
|
||||
break;
|
||||
case "right":
|
||||
this.speed.x = +(Math.random() * g.maxSpeedX + g.minSpeedX).toFixed(
|
||||
2
|
||||
);
|
||||
this.speed.x = +(Math.random() * g.maxSpeedX + g.minSpeedX).toFixed(2);
|
||||
break;
|
||||
default:
|
||||
(this.speed.x = +(
|
||||
-g.maxSpeedX / 2 +
|
||||
Math.random() * g.maxSpeedX
|
||||
).toFixed(2)),
|
||||
(this.speed.x = +(-g.maxSpeedX / 2 + Math.random() * g.maxSpeedX).toFixed(2)),
|
||||
(this.speed.x += this.speed.x > 0 ? g.minSpeedX : -g.minSpeedX);
|
||||
}
|
||||
switch (g.directionY) {
|
||||
case "up":
|
||||
this.speed.y = +(
|
||||
-g.maxSpeedY +
|
||||
Math.random() * g.maxSpeedY -
|
||||
g.minSpeedY
|
||||
).toFixed(2);
|
||||
this.speed.y = +(-g.maxSpeedY + Math.random() * g.maxSpeedY - g.minSpeedY).toFixed(2);
|
||||
break;
|
||||
case "down":
|
||||
this.speed.y = +(Math.random() * g.maxSpeedY + g.minSpeedY).toFixed(
|
||||
2
|
||||
);
|
||||
this.speed.y = +(Math.random() * g.maxSpeedY + g.minSpeedY).toFixed(2);
|
||||
break;
|
||||
default:
|
||||
(this.speed.y = +(
|
||||
-g.maxSpeedY / 2 +
|
||||
Math.random() * g.maxSpeedY
|
||||
).toFixed(2)),
|
||||
(this.speed.y = +(-g.maxSpeedY / 2 + Math.random() * g.maxSpeedY).toFixed(2)),
|
||||
(this.speed.x += this.speed.y > 0 ? g.minSpeedY : -g.minSpeedY);
|
||||
}
|
||||
}
|
||||
@@ -221,10 +192,7 @@
|
||||
b.position.x + b.parallaxOffsetX,
|
||||
b.position.y + b.parallaxOffsetY
|
||||
)
|
||||
: s.lineTo(
|
||||
b.position.x + b.parallaxOffsetX,
|
||||
b.position.y + b.parallaxOffsetY
|
||||
));
|
||||
: s.lineTo(b.position.x + b.parallaxOffsetX, b.position.y + b.parallaxOffsetY));
|
||||
}
|
||||
s.stroke(), s.closePath();
|
||||
}),
|
||||
@@ -236,14 +204,10 @@
|
||||
var b = (v - 0) / 60;
|
||||
x = (F - -30) * b + 0;
|
||||
} else (w = A), (x = B);
|
||||
(this.parallaxTargX =
|
||||
(w - u / 2) / (g.parallaxMultiplier * this.layer)),
|
||||
(this.parallaxOffsetX +=
|
||||
(this.parallaxTargX - this.parallaxOffsetX) / 10),
|
||||
(this.parallaxTargY =
|
||||
(x - v / 2) / (g.parallaxMultiplier * this.layer)),
|
||||
(this.parallaxOffsetY +=
|
||||
(this.parallaxTargY - this.parallaxOffsetY) / 10);
|
||||
(this.parallaxTargX = (w - u / 2) / (g.parallaxMultiplier * this.layer)),
|
||||
(this.parallaxOffsetX += (this.parallaxTargX - this.parallaxOffsetX) / 10),
|
||||
(this.parallaxTargY = (x - v / 2) / (g.parallaxMultiplier * this.layer)),
|
||||
(this.parallaxOffsetY += (this.parallaxTargY - this.parallaxOffsetY) / 10);
|
||||
}
|
||||
var c = d.offsetWidth,
|
||||
e = d.offsetHeight;
|
||||
@@ -326,8 +290,7 @@
|
||||
return "object" != typeof a && a
|
||||
? void 0
|
||||
: this.each(function () {
|
||||
f.data(this, "plugin_" + e) ||
|
||||
f.data(this, "plugin_" + e, new d(this, a));
|
||||
f.data(this, "plugin_" + e) || f.data(this, "plugin_" + e, new d(this, a));
|
||||
});
|
||||
});
|
||||
})(window, document),
|
||||
@@ -344,8 +307,7 @@
|
||||
)
|
||||
(window.requestAnimationFrame = window[b[c] + "RequestAnimationFrame"]),
|
||||
(window.cancelAnimationFrame =
|
||||
window[b[c] + "CancelAnimationFrame"] ||
|
||||
window[b[c] + "CancelRequestAnimationFrame"]);
|
||||
window[b[c] + "CancelAnimationFrame"] || window[b[c] + "CancelRequestAnimationFrame"]);
|
||||
window.requestAnimationFrame ||
|
||||
(window.requestAnimationFrame = function (b) {
|
||||
var c = new Date().getTime(),
|
||||
|
||||
@@ -5,6 +5,7 @@ body {
|
||||
-webkit-user-select: none;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
body .vertical-centered-box {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
|
||||
18
package.json
18
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ms-365-electron",
|
||||
"version": "2.0.0",
|
||||
"version": "2.1.0",
|
||||
"type": "module",
|
||||
"description": "Unofficial Microsoft 365 Web Desktop Wrapper made with Electron",
|
||||
"main": "./app/main.js",
|
||||
@@ -67,12 +67,13 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"electron": "^30.0.0",
|
||||
"electron-builder": "^24.6.3",
|
||||
"eslint": "^9.0.0"
|
||||
"electron": "^35.0.0",
|
||||
"electron-builder": "^25.0.0",
|
||||
"eslint": "^9.0.0",
|
||||
"prettier": "^3.1.0",
|
||||
"prettier-eslint": "^16.1.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@aptabase/electron": "^0.3.1",
|
||||
"@cliqz/adblocker-electron": "^1.26.6",
|
||||
"@xhayper/discord-rpc": "^1.0.21",
|
||||
"axios": "^1.4.0",
|
||||
@@ -81,9 +82,10 @@
|
||||
"electron-context-menu": "^4.0.0",
|
||||
"electron-dl": "^4.0.0",
|
||||
"electron-log": "^5.0.0-beta.25",
|
||||
"electron-store": "^9.0.0",
|
||||
"electron-prompt": "^1.7.0",
|
||||
"electron-store": "^10.0.0",
|
||||
"electron-updater": "^6.1.4",
|
||||
"node-gyp": "^10.0.0"
|
||||
"node-gyp": "^11.0.0"
|
||||
},
|
||||
"packageManager": "yarn@4.2.1"
|
||||
"packageManager": "yarn@4.7.0"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:base"
|
||||
]
|
||||
"extends": ["config:base"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user