Compare commits

..

62 Commits

Author SHA1 Message Date
Agampreet Singh
f82837ac4f Update README.md 2023-06-12 23:54:50 +05:30
Agampreet Singh
6c1edd0a98 Do not include assets/icons in extraFiles 2023-06-12 19:41:25 +05:30
Agampreet Singh
72516bd2fd Add a "Copy URL" button in menu 2023-06-12 15:15:33 +05:30
Agampreet Singh
38a4db3538 Rearrange menu 2023-06-12 15:01:02 +05:30
Agampreet Singh
aab2397043 Use a better way to check menu item 2023-06-12 13:27:49 +05:30
Agampreet Singh
034e2f36c3 Shorten menu label/description 2023-06-12 13:27:41 +05:30
Agampreet Singh
b44ee69787 Make the menu feel more native 2023-06-12 12:42:59 +05:30
Agampreet Singh
0ba2721ea3 Add option to enable/disable auto updater 2023-06-12 00:49:47 +05:30
Agampreet Singh
d2ed102ccc Rearrange MS-365-Electron menu 2023-06-12 00:35:08 +05:30
Agampreet Singh
dd8110479b Add accelerator for Back, Forward and Reload buttons 2023-06-11 23:24:54 +05:30
Agampreet Singh
848e93ae09 Let user enable/disable "Dynamic Icons"
- Auto Icon Changer will be called "Dynamic Icons" from now on
2023-06-11 23:20:17 +05:30
Agampreet Singh
1625a46529 Only keep "Block Ads and Trackers" option 2023-06-11 22:50:00 +05:30
Agampreet Singh
1526a81d1c Update user-agent strings 2023-06-11 21:54:56 +05:30
Agampreet Singh
5b4db16b64 Do not log if internet is connected 2023-06-11 21:49:09 +05:30
Agampreet Singh
0e02c64999 Cleanup the main file 2023-06-11 21:48:03 +05:30
Agampreet Singh
9d2b63fedb Move everything related to store in store.js 2023-06-11 21:15:36 +05:30
Agampreet Singh
15d339d7f9 Add OneDrive option under Apps menu 2023-06-11 21:00:59 +05:30
Agampreet Singh
ec12b02d7e Add "Apps" menu 2023-06-11 21:00:49 +05:30
Agampreet Singh
e003c64444 Update LICENSE 2023-06-11 18:17:38 +05:30
Agampreet Singh
e680f8eb37 Welcome back about-window! 2023-06-11 18:16:30 +05:30
Agampreet Singh
1e1828b3f2 Rename menu label 2023-06-11 17:49:27 +05:30
Agampreet Singh
a9d63d7325 Use rpcError function for all RPC related errors
- Also add "Disable Discord RPC" button to the error message
2023-06-11 17:48:30 +05:30
Agampreet Singh
95e14db4f8 Only change icons if some window is focused
- This commit fixes the error shown if no window is focused
2023-06-11 17:39:53 +05:30
Agampreet Singh
6a294dadd0 Use URL to check which website is opened 2023-06-11 17:39:02 +05:30
Agampreet Singh
f42c6c80b2 Support automatic icon changer for Windows 2023-06-11 00:08:59 +05:30
Agampreet Singh
72ddfe7b62 Rename icon file names 2023-06-10 14:55:43 +05:30
Agampreet Singh
5a70499ad0 Update Discord RPC whenever a new window is created 2023-06-10 11:55:22 +05:30
Agampreet Singh
2a0b175c78 Introducing ads/tracking blocker! 2023-06-10 01:24:08 +05:30
renovate[bot]
5f69e53123 Update dependency electron to v25 (#115)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-09 22:44:50 +05:30
renovate[bot]
1ef0457246 Update actions/upload-artifact action to v3 (#114)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-09 22:44:42 +05:30
renovate[bot]
38f04012b5 Update actions/checkout action to v3 (#112)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-09 22:44:30 +05:30
renovate[bot]
b708b9e0e2 Update Yarn to v3.6.0 (#111)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-09 22:44:17 +05:30
renovate[bot]
5c1421f3bb Add renovate.json (#110)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-09 22:42:15 +05:30
Agampreet Singh
2997e82cad Change icons according to the website opened
- macOS Only for now
2023-06-09 22:37:14 +05:30
Agampreet Singh
924183dc84 Update artifact's file's path to be uploaded 2023-06-09 22:37:14 +05:30
Agampreet Singh
71557c205c Add ci workflow to build from source 2023-06-09 22:31:16 +05:30
Agampreet Singh
401ba1c879 Use autoUpdater for checking for updates if on macOS or Windows 2023-06-09 22:09:31 +05:30
Agampreet Singh
e788a933d5 Make the Application menu more native for macOS 2023-06-09 22:08:30 +05:30
Agampreet Singh
803c9bde90 Update dependencies 2023-06-09 18:09:31 +05:30
Agampreet Singh
98f0a57307 Only include the icons folder while building 2023-06-09 18:08:58 +05:30
Agampreet Singh
cf8ee83edc Welcome back, Discord RPC
- Use new image for the RPC
- Switch to an updated library
2023-06-09 17:04:37 +05:30
Agampreet Singh
406b7041f2 Lower the website's preview image 2023-06-08 17:00:57 +05:30
Agampreet Singh
8b3103c318 Switch to San Franciso font in the website 2023-06-08 16:43:52 +05:30
Agampreet Singh
b0746d48ec Upload new website 2023-06-08 16:26:39 +05:30
Agampreet Singh
ac4d21cdf9 Update the website's code
- Rewrote the description
- Updated branding, including name, logo, etc
- Use new screenshot and device mockup
- Use new background image
2023-06-06 01:01:45 +05:30
Agampreet Singh
2f82a165f8 Remove window role and only show menu bar hide option if OS is windows or linux 2023-06-05 20:34:56 +05:30
Agampreet Singh
122c78cb92 Lord knows what I did
- Separate code into different files
- Drop about-window
- Drop Discord RPC
- Cleanup
- Maybe more?
2023-06-05 20:12:06 +05:30
Agampreet Singh
bec002d50a Drop build script 2023-06-05 16:40:14 +05:30
Agampreet Singh
c417702de6 Remove eslint and prettier related files 2023-06-05 16:39:08 +05:30
Agampreet Singh
cecd797ee2 Move screenshots to assets folder 2023-06-05 16:38:06 +05:30
Agampreet Singh
9da7d35d0e Move banner to assets folder 2023-06-05 16:36:07 +05:30
Agampreet Singh
7826a40187 Add smaller icon for "About MS-365-Electron" window 2023-03-28 19:12:48 +05:30
Agampreet Singh
5ceccb3510 Edit menulayout 2023-03-27 01:00:01 +05:30
Agampreet Singh
97ac91b64a Ignore C/C++ build files from packaging in macOS builds 2023-03-27 01:00:01 +05:30
Agampreet Singh
10da125fed Update version to 0.9.0 2023-03-27 01:00:01 +05:30
Agampreet Singh
b3d857f095 Let the download url be opened in a new window
When we download a file from, for example Word, it redirects to a new tab. When a user has "Open Websites in the Same Window" option selected, they will see a blank page in the window after they download something. This commit lets these types of download urls to be opened in new tabs, even if the user has selected to open all the urls in same window.
2023-03-25 18:23:22 +05:30
Agampreet Singh
3deb15080f Remove ESLint workflow 2023-03-25 18:09:22 +05:30
Agampreet Singh
8a2e48c3c0 Update useragent strings 2023-03-25 18:07:40 +05:30
Agampreet Singh
8b72100ae4 Rename UserAgent switcher labels 2023-03-25 18:04:17 +05:30
Agampreet Singh
fe1e564dff Update dependencies 2023-03-24 00:29:55 +05:30
Agampreet Singh
f4b9f6d421 Add new icon for macOS builds 2023-03-24 00:29:05 +05:30
Agampreet Singh
4c2effbbd4 Add FUNDING.yml 2023-03-13 12:41:33 +05:30
148 changed files with 3267 additions and 19440 deletions

View File

@@ -1,5 +0,0 @@
yarn.lock
node_modules/
docs/
.github/
README.md

View File

@@ -1,15 +0,0 @@
module.exports = {
"env": {
"commonjs": true,
"es2021": true,
"node": true
},
"extends": "eslint:recommended",
"overrides": [
],
"parserOptions": {
"ecmaVersion": "latest"
},
"rules": {
}
}

2
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,2 @@
github: agam778
ko_fi: agam778

View File

@@ -12,7 +12,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3

49
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
name: CI
on: workflow_dispatch
jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version: latest
- name: Build with Electron Builder
run: |
export GH_TOKEN=${{ secrets.GITHUB_TOKEN }}
yarn
if [ "$RUNNER_OS" == "Linux" ]; then
yarn dist --publish never
elif [ "$RUNNER_OS" == "Windows" ]; then
yarn dist --publish never
elif [ "$RUNNER_OS" == "macOS" ]; then
yarn dist -m --x64 --arm64 --publish never
else
echo "$RUNNER_OS not supported"
exit 1
fi
shell: bash
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-dist
path: |
release/*.exe
release/*.dmg
release/*.deb
release/*.snap
release/*.tar.gz
release/*.AppImage
release/*.rpm

View File

@@ -1,50 +0,0 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# ESLint is a tool for identifying and reporting on patterns
# found in ECMAScript/JavaScript code.
# More details at https://github.com/eslint/eslint
# and https://eslint.org
name: ESLint
on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '16 11 * * 0'
jobs:
eslint:
name: Run eslint scanning
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install ESLint
run: |
npm install eslint@8.10.0
npm install @microsoft/eslint-formatter-sarif@2.1.7
- name: Run ESLint
run: npx eslint .
--config .eslintrc.js
--ext .js,.jsx,.ts,.tsx
--format @microsoft/eslint-formatter-sarif
--output-file eslint-results.sarif
continue-on-error: true
- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: eslint-results.sarif
wait-for-processing: true

View File

@@ -1,3 +0,0 @@
yarn.lock
node_modules/
README.md

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

874
.yarn/releases/yarn-3.6.0.cjs vendored Executable file

File diff suppressed because one or more lines are too long

View File

@@ -4,4 +4,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
yarnPath: .yarn/releases/yarn-3.4.1.cjs
yarnPath: .yarn/releases/yarn-3.6.0.cjs

View File

@@ -1,6 +1,7 @@
MIT License
Copyright (c) 2021-2023 Agampreet Singh
Microsoft 365, the name, website, images/icons are the intellectual properties of Microsoft.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,4 +1,4 @@
<p align="center"><img src="https://github.com/agam778/MS-365-Electron/blob/main/Intro_Image.png?raw=true" alt="Intro Image"></p>
<p align="center"><img src="https://github.com/agam778/MS-365-Electron/blob/main/assets/banner.png?raw=true" alt="Intro Image"></p>
<p align="center">Thanks a lot to <a href="https://t.me/NextWorksGFX">@NextWorksGFX</a> for this amazing banner!</p>
<p align="center">Unofficial Microsoft 365 Web Desktop Wrapper made with Electron</p>
@@ -72,7 +72,13 @@ Supported Platforms
# List of Features
- Discord Rich Presence
- Discord RPC
- Dynamic Icons:
- For macOS: Change icon in dock according to the app you've opened [[Preview]](https://github-production-user-asset-6210df.s3.amazonaws.com/68941022/245203309-3d0dfc1b-02e9-43a8-85d7-9493a2b86b56.mp4)
- For Windows: Set overlay icon [[Preview]](https://github.com/agam778/MS-365-Electron/assets/68941022/791b661b-2b7d-43a6-96df-ee9c30c9b18a)
- For Linux: Nothing, yet
- Block Ads within the app
- Directly open apps from the menu
- Ability to use useragent strings of Windows, macOS or Linux
- Switch between normal and enterprise/education/developer account in the same app
- Back, Forward, Reload, and Home buttons
@@ -92,8 +98,8 @@ For Installing this app on Windows:
<details>
<summary>Click to expand</summary>
<img src="https://github.com/agam778/MS-365-Electron/blob/main/Preview/windows_1.png?raw=true" alt="Windows Preview - 1">
<img src="https://github.com/agam778/MS-365-Electron/blob/main/Preview/windows_2.png?raw=true" alt="Windows Preview - 2">
<img src="https://github.com/agam778/MS-365-Electron/blob/main/assets/screenshots/windows_1.png?raw=true" alt="Windows Preview - 1">
<img src="https://github.com/agam778/MS-365-Electron/blob/main/assets/screenshots/windows_2.png?raw=true" alt="Windows Preview - 2">
</details>
# macOS
@@ -106,6 +112,13 @@ For Installing this app on Mac :-
2. Scroll down and click the `.dmg` file (according to your system architecture).
3. After it downloads, click on the file and mount it on your system. Now drag my app to the Applications Folder (There will be a shortcut in the opened window too) and your app will be installed. Open from Launchpad and enjoy.
## 📸 macOS Preview
<details>
<summary>Click to expand</summary>
<img src="https://github.com/agam778/MS-365-Electron/assets/68941022/fcc24409-7e4b-4802-9f3f-a7c420c0edcb" alt="macOS Preview">
</details>
# Linux
## 💿 Installation on Linux
@@ -160,20 +173,8 @@ For Installing in Red Hat/Fedora based distribution :-
sudo emerge -a ms-office-electron
```
## 📸 Ubuntu Preview
[Click Here](https://github.com/agam778/MS-365-Electron/blob/main/Preview/Ubuntu%20Preview.png?raw=true)
# 💻 Developing Locally
To build the app locally:<br>
Run this script to automatically install `nodejs`, `yarn` and all the dependencies, and automatically start/build the app (it will show options) (Note: for Linux and macOS Only!):
```bash
git clone https://github.com/agam778/MS-365-Electron.git
cd MS-365-Electron
bash build.sh
```
<br>
Or:<br>
Run the following commands to clone the repository and install the dependencies
```bash

344
app/main.js Normal file
View File

@@ -0,0 +1,344 @@
const { app, Menu, BrowserWindow, dialog, nativeImage } = require("electron");
const { autoUpdater } = require("electron-updater");
const checkInternetConnected = require("check-internet-connected");
const ElectronDl = require("electron-dl");
const contextMenu = require("electron-context-menu");
const path = require("path");
const log = require("electron-log");
const { setActivity, loginToRPC, clearActivity } = require("./rpc");
const useragents = require("./useragents.json");
const { ElectronBlocker } = require("@cliqz/adblocker-electron");
const { getValue } = require("./store");
const { menulayout } = require("./menu");
log.transports.file.level = "verbose";
console.log = log.log;
Object.assign(console, log.functions);
function createWindow() {
const win = new BrowserWindow({
width: 1181,
height: 670,
icon: path.join(__dirname, "/assets/icons/png/1024x1024.png"),
show: false,
webPreferences: {
nodeIntegration: true,
devTools: true,
},
});
if (getValue("autohide-menubar") === "true") {
win.setAutoHideMenuBar(true);
} else {
win.setAutoHideMenuBar(false);
}
const splash = new BrowserWindow({
width: 810,
height: 610,
transparent: true,
frame: false,
alwaysOnTop: true,
icon: path.join(__dirname, "/assets/icons/png/1024x1024.png"),
});
splash.loadURL(`https://agam778.github.io/MS-365-Electron/loading`);
win.loadURL(
`${getValue("enterprise-or-normal") || "https://microsoft365.com/?auth=1"}`,
{
userAgent: getValue("useragentstring") || useragents.Windows,
}
);
win.webContents.on("did-finish-load", () => {
splash.destroy();
win.show();
if (getValue("discordrpcstatus") === "true") {
setActivity(`On "${win.webContents.getTitle()}"`);
}
if (getValue("blockadsandtrackers") === "true") {
ElectronBlocker.fromPrebuiltAdsAndTracking(fetch).then((blocker) => {
blocker.enableBlockingInSession(win.webContents.session);
});
}
});
}
ElectronDl({
dlPath: "./downloads",
onStarted: (item) => {
BrowserWindow.getAllWindows().forEach((window) => {
window.setOverlayIcon(
__dirname + "/assets/icons/download.png",
"Downloading"
);
});
dialog.showMessageBox({
type: "info",
title: "Downloading File",
message: `Downloading "${item.getFilename()}" to "${item.getSavePath()}"`,
buttons: ["OK"],
});
},
onCompleted: () => {
BrowserWindow.getAllWindows().forEach((window) => {
window.setOverlayIcon(
__dirname + "/assets/icons/download-success.png",
"Download Successful"
);
});
dialog.showMessageBox({
type: "info",
title: "Download Completed",
message: `Downloading Completed! Please check your "Downloads" folder.`,
buttons: ["OK"],
});
setTimeout(() => {
BrowserWindow.getAllWindows().forEach((window) => {
window.setOverlayIcon(null, "");
});
}, 7000);
},
onError: (item) => {
dialog.showMessageBox({
type: "error",
title: "Download failed",
message: `Downloading "${item.getFilename()}" failed :(`,
buttons: ["OK"],
});
BrowserWindow.getAllWindows().forEach((window) => {
window.setOverlayIcon(
__dirname + "/download-fail.png",
"Download Failed"
);
});
setTimeout(() => {
BrowserWindow.getAllWindows().forEach((window) => {
window.setOverlayIcon(null, "");
});
}, 7000);
},
});
contextMenu({
showInspectElement: false,
showServices: false,
});
Menu.setApplicationMenu(Menu.buildFromTemplate(menulayout));
app.on("ready", () => {
createWindow();
});
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);
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" };
}
});
contents.on("did-finish-load", () => {
if (getValue("dynamicicons") === "true") {
if (BrowserWindow.getFocusedWindow()) {
if (
BrowserWindow.getFocusedWindow()
.webContents.getURL()
.includes("&ithint=file%2cpptx")
) {
if (process.platform === "darwin") {
app.dock.setIcon(
path.join(__dirname, "../assets/icons/apps/powerpoint-mac.png")
);
} else if (process.platform === "win32") {
let nimage = nativeImage.createFromPath(
path.join(__dirname, "../assets/icons/apps/powerpoint.png")
);
BrowserWindow.getAllWindows().forEach((window) => {
window.setOverlayIcon(nimage, "PowerPoint");
});
}
} else if (
BrowserWindow.getFocusedWindow()
.webContents.getURL()
.includes("&ithint=file%2cdocx")
) {
if (process.platform === "darwin") {
app.dock.setIcon(
path.join(__dirname, "../assets/icons/apps/word-mac.png")
);
} else if (process.platform === "win32") {
let nimage = nativeImage.createFromPath(
path.join(__dirname, "../assets/icons/apps/word.png")
);
BrowserWindow.getAllWindows().forEach((window) => {
window.setOverlayIcon(nimage, "Word");
});
}
} else if (
BrowserWindow.getFocusedWindow()
.webContents.getURL()
.includes("&ithint=file%2cxlsx")
) {
if (process.platform === "darwin") {
app.dock.setIcon(
path.join(__dirname, "../assets/icons/apps/excel-mac.png")
);
} else if (process.platform === "win32") {
let nimage = nativeImage.createFromPath(
path.join(__dirname, "../assets/icons/apps/excel.png")
);
BrowserWindow.getAllWindows().forEach((window) => {
window.setOverlayIcon(nimage, "Excel");
});
}
} else if (
BrowserWindow.getFocusedWindow()
.webContents.getURL()
.includes("outlook.live.com")
) {
if (process.platform === "darwin") {
app.dock.setIcon(
path.join(__dirname, "../assets/icons/apps/outlook-mac.png")
);
} else if (process.platform === "win32") {
let nimage = nativeImage.createFromPath(
path.join(__dirname, "../assets/icons/apps/outlook.png")
);
BrowserWindow.getAllWindows().forEach((window) => {
window.setOverlayIcon(nimage, "Outlook");
});
}
} else if (
BrowserWindow.getFocusedWindow()
.webContents.getURL()
.includes("onedrive.live.com")
) {
if (process.platform === "darwin") {
app.dock.setIcon(
path.join(__dirname, "../assets/icons/apps/onedrive-mac.png")
);
} else if (process.platform === "win32") {
let nimage = nativeImage.createFromPath(
path.join(__dirname, "../assets/icons/apps/onedrive.png")
);
BrowserWindow.getAllWindows().forEach((window) => {
window.setOverlayIcon(nimage, "OneDrive");
});
}
} else if (
BrowserWindow.getFocusedWindow()
.webContents.getURL()
.includes("teams.live.com")
) {
if (process.platform === "darwin") {
app.dock.setIcon(
path.join(__dirname, "../assets/icons/apps/teams-mac.png")
);
} else if (process.platform === "win32") {
let nimage = nativeImage.createFromPath(
path.join(__dirname, "../assets/icons/apps/teams.png")
);
BrowserWindow.getAllWindows().forEach((window) => {
window.setOverlayIcon(nimage, "Teams");
});
}
} else if (
BrowserWindow.getFocusedWindow()
.webContents.getURL()
.includes("&ithint=onenote")
) {
if (process.platform === "darwin") {
app.dock.setIcon(
path.join(__dirname, "../assets/icons/apps/onenote-mac.png")
);
} else if (process.platform === "win32") {
let nimage = nativeImage.createFromPath(
path.join(__dirname, "../assets/icons/apps/onenote.png")
);
BrowserWindow.getAllWindows().forEach((window) => {
window.setOverlayIcon(nimage, "OneNote");
});
}
} else {
if (process.platform === "darwin") {
app.dock.setIcon(null);
} else {
BrowserWindow.getAllWindows().forEach((window) => {
window.setOverlayIcon(null, "");
});
}
}
}
}
});
});
app.on("browser-window-created", (event, window) => {
window.webContents.on("did-finish-load", () => {
if (getValue("discordrpcstatus") === "true") {
setActivity(`On "${window.webContents.getTitle()}"`);
}
});
if (getValue("blockadsandtrackers") === "true") {
ElectronBlocker.fromPrebuiltAdsAndTracking(fetch).then((blocker) => {
blocker.enableBlockingInSession(window.webContents.session);
});
}
});
app.on("window-all-closed", () => {
if (process.platform !== "darwin") {
app.quit();
}
if (process.platform === "darwin") {
app.dock.setIcon(null);
}
clearActivity();
});
app.on("activate", () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
}
});
app.on("ready", function () {
checkInternetConnected().catch(() => {
const options = {
type: "warning",
buttons: ["Ok"],
defaultId: 2,
title: "Warning",
message: "You appear to be offline!",
detail:
"Please check your Internet Connectivity. This app cannot run without an Internet Connection!",
};
dialog.showMessageBox(null, options, (response) => {
console.log(response);
});
});
if (getValue("autoupdater") === "true") {
autoUpdater.checkForUpdatesAndNotify();
}
if (getValue("discordrpcstatus") === "true") {
loginToRPC();
setActivity(`Opening Microsoft 365...`);
}
});

1229
app/menu.js Normal file

File diff suppressed because it is too large Load Diff

57
app/rpc.js Normal file
View File

@@ -0,0 +1,57 @@
const { Client } = require("@xhayper/discord-rpc");
const { dialog, BrowserWindow } = require("electron");
const { setValue } = require("./store");
const client = new Client({
clientId: "942637872530460742",
});
async function rpcError(status) {
const rpcerror = dialog.showMessageBoxSync(BrowserWindow.getFocusedWindow(), {
type: "error",
title: "Discord RPC Error",
message: `Oops! An Error occured while ${status} Discord RPC.`,
buttons: ["Close", "Disable Discord RPC"],
});
if (rpcerror === 1) {
setValue("discordrpcstatus", "false");
}
}
async function clearActivity() {
await client.user?.clearActivity().catch((err) => {
rpcError("clearing");
console.error(err);
});
}
async function setActivity(details) {
if (!client.user) {
await loginToRPC();
}
await client.user
?.setActivity({
details: details,
startTimestamp: Date.now(),
largeImageKey: "icon",
largeImageText: "MS-365-Electron",
})
.catch((err) => {
rpcError("setting");
console.error(err);
});
}
async function loginToRPC() {
await client.login().catch((err) => {
rpcError("logging into");
console.error(err);
});
}
module.exports = {
clearActivity,
setActivity,
loginToRPC,
};

21
app/store.js Normal file
View File

@@ -0,0 +1,21 @@
const Store = require("electron-store");
const store = new Store();
function getValue(key) {
return store.get(key);
}
function setValue(key, value) {
store.set(key, value);
}
function getValueOrDefault(key, defaultValue) {
const value = store.get(key);
if (value === undefined) {
store.set(key, defaultValue);
return defaultValue;
}
return value;
}
module.exports = { getValue, setValue, getValueOrDefault };

5
app/useragents.json Normal file
View File

@@ -0,0 +1,5 @@
{
"Windows": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
"macOS": "Mozilla/5.0 (Macintosh; Intel Mac OS X 13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
"Linux": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
}

BIN
assets/about.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 MiB

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

BIN
assets/icons/apps/excel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

BIN
assets/icons/apps/teams.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

BIN
assets/icons/apps/word.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 209 KiB

After

Width:  |  Height:  |  Size: 209 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

View File

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 1.6 MiB

224
build.sh
View File

@@ -1,224 +0,0 @@
#!/bin/bash
# This script helps you to start/build the MS-Office-Electron app
if ! [ -x "$(command -v node)" ]; then
echo 'Error: nodejs is not installed.' >&2
echo 'Installing nodejs now; this may take a while.'
if [ "$(uname)" == "Linux" ]; then
if [ "$(id -u)" != "0" ]; then
if [ -f /etc/debian_version ]; then
curl -fsSL https://deb.nodesource.com/setup_17.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install rpm -y # for rpm build.
elif [ -f /etc/redhat-release ]; then
sudo yum install nodejs
elif [ -f /etc/arch-release ]; then
sudo pacman -S nodejs
elif [ -f /etc/gentoo-release ]; then
sudo emerge nodejs
elif [ -f /etc/SuSE-release ]; then
sudo zypper install nodejs
elif [ -f /etc/fedora-release ]; then
sudo dnf install nodejs
elif [ -f /etc/centos-release ]; then
sudo yum install nodejs
elif [ -f /etc/nixos ]; then
sudo nix-env -iA nodejs
fi
else
if [ -f /etc/debian_version ]; then
curl -fsSL https://deb.nodesource.com/setup_17.x | bash -
apt-get install -y nodejs
elif [ -f /etc/redhat-release ]; then
yum install nodejs
elif [ -f /etc/arch-release ]; then
pacman -S nodejs
elif [ -f /etc/gentoo-release ]; then
emerge nodejs
elif [ -f /etc/SuSE-release ]; then
zypper install nodejs
elif [ -f /etc/fedora-release ]; then
dnf install nodejs
elif [ -f /etc/centos-release ]; then
yum install nodejs
elif [ -f /etc/nixos ]; then
nix-env -iA nodejs
fi
fi
elif [ "$(uname)" == "Darwin" ]; then
brew install node
elif [ "$(uname)" == "MINGW32_NT-10.0" ]; then
echo 'Error: nodejs is not installed.' >&2
echo 'Please install nodejs manually.'
exit 0
fi
fi
if ! [ -x "$(command -v yarn)" ]; then
echo 'Error: yarn is not installed.' >&2
echo 'Installing yarn now; this may take a while.'
if [ "$(uname)" == "Linux" ]; then
if [ "$(id -u)" != "0" ]; then
if [ -f /etc/debian_version ]; then
sudo apt-get install -y yarn
elif [ -f /etc/redhat-release ]; then
sudo yum install yarn
elif [ -f /etc/arch-release ]; then
sudo pacman -S yarn
elif [ -f /etc/gentoo-release ]; then
sudo emerge yarn
elif [ -f /etc/SuSE-release ]; then
sudo zypper install yarn
elif [ -f /etc/fedora-release ]; then
sudo dnf install yarn
elif [ -f /etc/centos-release ]; then
sudo yum install yarn
elif [ -f /etc/nixos ]; then
sudo nix-env -iA yarn
fi
else
if [ -f /etc/debian_version ]; then
apt-get install -y yarn
elif [ -f /etc/redhat-release ]; then
yum install yarn
elif [ -f /etc/arch-release ]; then
pacman -S yarn
elif [ -f /etc/gentoo-release ]; then
emerge yarn
elif [ -f /etc/SuSE-release ]; then
zypper install yarn
elif [ -f /etc/fedora-release ]; then
dnf install yarn
elif [ -f /etc/centos-release ]; then
yum install yarn
elif [ -f /etc/nixos ]; then
nix-env -iA yarn
fi
fi
elif [ "$(uname)" == "Darwin" ]; then
brew install yarn
elif [ "$(uname)" == "MINGW32_NT-10.0" ]; then
echo 'Error: yarn is not installed.' >&2
echo 'Please install yarn manually.'
exit 0
fi
fi
if [ -d "./.git" ]; then
echo "Detected a cloned repository, Continuing..."
else
echo "Repository not found, cloning now..."
if ! [ -x "$(command -v git)" ]; then
echo 'Error: git is not installed.' >&2
echo 'Installing git now; this may take a while.'
if [ "$(uname)" == "Linux" ]; then
if [ "$(id -u)" == "0" ]; then
if [ -f /etc/debian_version ]; then
apt-get install git
elif [ -f /etc/redhat-release ]; then
yum install git
elif [ -f /etc/arch-release ]; then
pacman -S git
elif [ -f /etc/gentoo-release ]; then
emerge git
elif [ -f /etc/SuSE-release ]; then
zypper install git
elif [ -f /etc/fedora-release ]; then
dnf install git
elif [ -f /etc/centos-release ]; then
yum install git
elif [ -f /etc/nixos ]; then
nix-env -iA git
fi
else
if [ -f /etc/debian_version ]; then
sudo apt-get install git
elif [ -f /etc/redhat-release ]; then
sudo yum install git
elif [ -f /etc/arch-release ]; then
sudo pacman -S git
elif [ -f /etc/gentoo-release ]; then
sudo emerge git
elif [ -f /etc/SuSE-release ]; then
sudo zypper install git
elif [ -f /etc/fedora-release ]; then
sudo dnf install git
elif [ -f /etc/centos-release ]; then
sudo yum install git
elif [ -f /etc/nixos ]; then
sudo nix-env -iA git
fi
fi
elif [ "$(uname)" == "Darwin" ]; then
brew install git
elif [ "$(uname)" == "MINGW32_NT-10.0" ]; then
echo 'Error: git is not installed.' >&2
echo 'Please install git manually.'
fi
fi
git clone --depth=1 https://github.com/agam778/MS-Office-Electron; cd MS-Office-Electron || echo "Failed to change directory." && return 1
echo 'Cloned the repository'
fi
clear
echo 'Installing Dependencies'
if [ "$(id -u)" != "0" ]; then
sudo yarn install
else
yarn install
fi
clear
echo 'What do you want to do?'
echo '1. Run the app without building'
echo '2. Build the app'
echo '3. Build and install the app'
echo '4. Exit'
echo 'Enter your choice:'; read choice;
if [ "$choice" -eq "1" ]; then
echo 'Running the app...'
yarn start
elif [ "$choice" -eq "2" ]; then
echo 'Building the app...'
if [ "$(id -u)" != "0" ]; then
if [ "$(uname -m)" == "arm64" ]; then
sudo yarn dist --arm64
elif [ "$(uname -m)" == "x86_64" ]; then
sudo yarn dist --x64
fi
else
if [ "$(uname -m)" == "arm64" ]; then
yarn dist --arm64
elif [ "$(uname -m)" == "x86_64" ]; then
yarn dist --x64
fi
fi
elif [ "$choice" -eq "3" ]; then
echo 'Building and installing the app...'
if ! [ -f /etc/debian_version ]; then
echo 'Error: "Build and install the app" option is only supported on Debian-based systems for now.' >&2
exit 0
fi
if [ "$(id -u)" != "0" ]; then
if [ "$(uname -m)" == "arm64" ]; then
sudo yarn dist --arm64
sudo apt install -y -f ./release/MS-Office-Electron*.deb
elif [ "$(uname -m)" == "x86_64" ]; then
sudo yarn dist --x64
sudo apt install -y -f ./release/MS-Office-Electron*.deb
fi
else
if [ "$(uname -m)" == "arm64" ]; then
yarn dist --arm64
apt install -y -f ./release/MS-Office-Electron*.deb
elif [ "$(uname -m)" == "x86_64" ]; then
yarn dist --x64
apt install -y -f ./release/MS-Office-Electron*.deb
fi
fi
elif [ "$choice" -eq "4" ]; then
echo 'Exiting...'
exit 1
fi
echo 'Finished successfully! 🎉 '
exit 0

View File

@@ -1,7 +0,0 @@
# MS-Office-Electron
A Microsoft Office Online Desktop Client made with Electron. Free of Cost.
# Website
Just a website for the MS-Office-Electron App, nothing much

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -1,150 +0,0 @@
/* breakpoints.js v1.0 | @ajlkn | MIT licensed */
var breakpoints = (function () {
"use strict";
function e(e) {
t.init(e);
}
var t = {
list: null,
media: {},
events: [],
init: function (e) {
(t.list = e),
window.addEventListener("resize", t.poll),
window.addEventListener("orientationchange", t.poll),
window.addEventListener("load", t.poll),
window.addEventListener("fullscreenchange", t.poll);
},
active: function (e) {
var n, a, s, i, r, d, c;
if (!(e in t.media)) {
if (
(">=" == e.substr(0, 2)
? ((a = "gte"), (n = e.substr(2)))
: "<=" == e.substr(0, 2)
? ((a = "lte"), (n = e.substr(2)))
: ">" == e.substr(0, 1)
? ((a = "gt"), (n = e.substr(1)))
: "<" == e.substr(0, 1)
? ((a = "lt"), (n = e.substr(1)))
: "!" == e.substr(0, 1)
? ((a = "not"), (n = e.substr(1)))
: ((a = "eq"), (n = e)),
n && n in t.list)
)
if (((i = t.list[n]), Array.isArray(i))) {
if (((r = parseInt(i[0])), (d = parseInt(i[1])), isNaN(r))) {
if (isNaN(d)) return;
c = i[1].substr(String(d).length);
} else c = i[0].substr(String(r).length);
if (isNaN(r))
switch (a) {
case "gte":
s = "screen";
break;
case "lte":
s = "screen and (max-width: " + d + c + ")";
break;
case "gt":
s = "screen and (min-width: " + (d + 1) + c + ")";
break;
case "lt":
s = "screen and (max-width: -1px)";
break;
case "not":
s = "screen and (min-width: " + (d + 1) + c + ")";
break;
default:
s = "screen and (max-width: " + d + c + ")";
}
else if (isNaN(d))
switch (a) {
case "gte":
s = "screen and (min-width: " + r + c + ")";
break;
case "lte":
s = "screen";
break;
case "gt":
s = "screen and (max-width: -1px)";
break;
case "lt":
s = "screen and (max-width: " + (r - 1) + c + ")";
break;
case "not":
s = "screen and (max-width: " + (r - 1) + c + ")";
break;
default:
s = "screen and (min-width: " + r + c + ")";
}
else
switch (a) {
case "gte":
s = "screen and (min-width: " + r + c + ")";
break;
case "lte":
s = "screen and (max-width: " + d + c + ")";
break;
case "gt":
s = "screen and (min-width: " + (d + 1) + c + ")";
break;
case "lt":
s = "screen and (max-width: " + (r - 1) + c + ")";
break;
case "not":
s =
"screen and (max-width: " +
(r - 1) +
c +
"), screen and (min-width: " +
(d + 1) +
c +
")";
break;
default:
s =
"screen and (min-width: " +
r +
c +
") and (max-width: " +
d +
c +
")";
}
} else s = "(" == i.charAt(0) ? "screen and " + i : i;
t.media[e] = !!s && s;
}
return t.media[e] !== !1 && window.matchMedia(t.media[e]).matches;
},
on: function (e, n) {
t.events.push({ query: e, handler: n, state: !1 }), t.active(e) && n();
},
poll: function () {
var e, n;
for (e = 0; e < t.events.length; e++)
(n = t.events[e]),
t.active(n.query)
? n.state || ((n.state = !0), n.handler())
: n.state && (n.state = !1);
},
};
return (
(e._ = t),
(e.on = function (e, n) {
t.on(e, n);
}),
(e.active = function (e) {
return t.active(e);
}),
e
);
})();
!(function (e, t) {
"function" == typeof define && define.amd
? define([], t)
: "object" == typeof exports
? (module.exports = t())
: (e.breakpoints = t());
})(this, function () {
return breakpoints;
});

Some files were not shown because too many files have changed in this diff Show More