Compare commits

..

41 Commits

Author SHA1 Message Date
ImgBotApp
92c24fe5c3 [ImgBot] Optimize images
*Total -- 2,709.42kb -> 2,291.87kb (15.41%)

/assets/icons/apps/teams-mac.png -- 214.75kb -> 161.18kb (24.95%)
/assets/icons/apps/powerpoint-mac.png -- 210.44kb -> 158.16kb (24.84%)
/assets/icons/apps/onedrive-mac.png -- 207.93kb -> 156.46kb (24.76%)
/assets/icons/apps/word-mac.png -- 208.16kb -> 159.28kb (23.48%)
/assets/icons/apps/onenote-mac.png -- 202.77kb -> 155.61kb (23.26%)
/assets/icons/apps/excel-mac.png -- 206.66kb -> 159.10kb (23.01%)
/assets/icons/apps/outlook-mac.png -- 217.81kb -> 171.70kb (21.17%)
/assets/icons/apps/teams.png -- 40.90kb -> 32.52kb (20.5%)
/assets/icons/apps/excel.png -- 37.14kb -> 29.68kb (20.1%)
/assets/icons/apps/onenote.png -- 29.78kb -> 24.04kb (19.26%)
/assets/icons/apps/word.png -- 35.80kb -> 29.63kb (17.24%)
/assets/icons/apps/onedrive.png -- 28.04kb -> 24.33kb (13.25%)
/assets/icons/apps/powerpoint.png -- 51.56kb -> 45.22kb (12.29%)
/assets/icons/apps/outlook.png -- 57.21kb -> 53.36kb (6.73%)
/docs/favicons/android-chrome-512x512.png -- 88.83kb -> 82.99kb (6.58%)
/docs/favicons/safari-pinned-tab.svg -- 2.82kb -> 2.63kb (6.51%)
/assets/about.png -- 227.74kb -> 213.94kb (6.06%)
/docs/favicons/android-chrome-192x192.png -- 22.97kb -> 21.96kb (4.4%)
/docs/favicons/mstile-150x150.png -- 13.28kb -> 12.86kb (3.18%)
/docs/favicons/apple-touch-icon.png -- 11.88kb -> 11.53kb (2.89%)
/docs/public/preview.png -- 592.95kb -> 585.70kb (1.22%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
2023-06-10 21:10:49 +00:00
Agampreet Singh
5303cf6906 Upload new website 2023-06-10 21:10:47 +00:00
Agampreet Singh
579f2014e4 Support automatic icon changer for Windows/Linux 2023-06-10 21:10:45 +00:00
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
146 changed files with 1902 additions and 19458 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,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,6 @@ Supported Platforms
# List of Features
- Discord Rich Presence
- 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 +91,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
@@ -162,18 +161,10 @@ For Installing in Red Hat/Fedora based distribution :-
## 📸 Ubuntu Preview
[Click Here](https://github.com/agam778/MS-365-Electron/blob/main/Preview/Ubuntu%20Preview.png?raw=true)
[Click Here](https://github.com/agam778/MS-365-Electron/blob/main/assets/screenshots/ubuntu.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

552
app/menu.js Normal file
View File

@@ -0,0 +1,552 @@
const store = require("./store");
const useragents = require("./useragents.json");
const { app, dialog, BrowserWindow } = require("electron");
const axios = require("axios");
const { clearActivity, setActivity } = require("./rpc");
const { shell } = require("electron");
const { autoUpdater } = require("electron-updater");
const { ElectronBlocker } = require("@cliqz/adblocker-electron");
const fetch = require("cross-fetch");
function getValueOrDefault(key, defaultValue) {
const value = store.get(key);
if (value === undefined) {
store.set(key, defaultValue);
return defaultValue;
}
return value;
}
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);
}
}
async function openExternalLink(url) {
const { shell } = require("electron");
await shell.openExternal(url);
}
async function openLogsFolder() {
const { shell } = require("electron");
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/"
);
}
}
function setUserAgent(useragent) {
store.set("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();
}
}
getValueOrDefault("enterprise-or-normal", "https://microsoft365.com/?auth=1");
getValueOrDefault("autohide-menubar", "false");
getValueOrDefault("useragentstring", useragents.Windows);
getValueOrDefault("discordrpcstatus", "false");
getValueOrDefault("blockads", "false");
getValueOrDefault("blockadsandtrackers", "false");
const menulayout = [
...(process.platform === "darwin"
? [
{
label: app.name,
submenu: [
{ label: "About MS-365-Electron", role: "about" },
{
label: "Learn More",
click: async () => {
await openExternalLink(
"https://github.com/agam778/MS-365-Electron"
);
},
},
{
label: "Check for Updates...",
id: "check-for-updates",
click: async () => {
await checkForUpdates();
},
},
{
label: "Open Logs Folder",
click: async () => {
await openLogsFolder();
},
},
{ type: "separator" },
{ role: "services" },
{ type: "separator" },
{ label: "Hide MS-365-Electron", role: "hide" },
{ role: "hideOthers" },
{ role: "unhide" },
{ type: "separator" },
{ label: "Quit MS-365-Electron", role: "quit" },
],
},
]
: []),
{
label: process.platform === "darwin" ? "Preferences" : "Application",
submenu: [
...(!process.platform === "darwin"
? [
{
label: "About MS-365-Electron",
click: () => {
// placeholder
},
},
]
: []),
...(!process.platform === "darwin"
? [
{
label: "Learn More",
click: async () => {
await openExternalLink(
"https://github.com/agam778/MS-365-Electron"
);
},
},
]
: []),
...(!process.platform === "darwin"
? [
{
label: "Check for Updates...",
id: "check-for-updates",
click: async () => {
await checkForUpdates();
},
},
]
: []),
...(!process.platform === "darwin"
? [
{
label: "Open Logs Folder",
click: async () => {
await openLogsFolder();
},
},
]
: []),
{ type: "separator" },
{
label: "Open Normal version of MS 365",
type: "radio",
click() {
store.set("enterprise-or-normal", "https://microsoft365.com/?auth=1");
dialog.showMessageBoxSync({
type: "info",
title: "Normal version of MS 365",
message:
"The normal version of MS 365 will be opened.\n\nPlease restart the app to apply the changes.",
buttons: ["OK"],
});
},
checked:
store.get("enterprise-or-normal") ===
"https://microsoft365.com/?auth=1",
},
{
label: "Open Enterprise version of MS 365",
type: "radio",
click() {
store.set("enterprise-or-normal", "https://microsoft365.com/?auth=2");
dialog.showMessageBoxSync({
type: "info",
title: "Enterprise version of MS 365",
message:
"The enterprise version of MS 365 will be opened.\n\nPlease restart the app to apply the changes.",
buttons: ["OK"],
});
},
checked:
store.get("enterprise-or-normal") ===
"https://microsoft365.com/?auth=2",
},
{ type: "separator" },
{
label: "Open Websites in New Windows (Recommended)",
type: "radio",
click: () => {
store.set("websites-in-new-window", "true");
dialog.showMessageBoxSync({
type: "info",
title: "Websites in New Windows",
message:
"Websites which are targeted to open in new tabs will now open in new windows.",
buttons: ["OK"],
});
},
checked: store.get("websites-in-new-window")
? store.get("websites-in-new-window") === "true"
: true,
},
{
label: "Open Websites in the Same Window",
type: "radio",
click: () => {
store.set("websites-in-new-window", "false");
dialog.showMessageBoxSync({
type: "info",
title: "Websites in New Windows",
message:
"Websites which are targeted to open in new tabs will now open in the same window.\n\nNote: This will be buggy in some cases if you are using Enterprise version of MS 365.",
buttons: ["OK"],
});
},
checked: store.get("websites-in-new-window")
? store.get("websites-in-new-window") === "false"
: false,
},
{ type: "separator" },
{
label: "Enable Discord RPC",
type: "checkbox",
click: () => {
if (store.get("discordrpcstatus") === "true") {
store.set("discordrpcstatus", "false");
dialog.showMessageBoxSync({
type: "info",
title: "Discord RPC",
message: "Discord RPC has been disabled.",
buttons: ["OK"],
});
clearActivity();
return;
} else if (
store.get("discordrpcstatus") === "false" ||
store.get("discordrpcstatus") === undefined
) {
store.set("discordrpcstatus", "true");
dialog.showMessageBoxSync({
type: "info",
title: "Discord RPC",
message: "Discord RPC has been enabled.",
buttons: ["OK"],
});
setActivity(
`On ${BrowserWindow.getFocusedWindow().webContents.getTitle()}`
);
return;
}
},
checked: store.get("discordrpcstatus") === "true",
},
{ type: "separator" },
{
label: "Block Ads",
type: "checkbox",
click: () => {
if (store.get("blockads") === "true") {
store.set("blockads", "false");
dialog.showMessageBoxSync({
type: "info",
title: "Block Ads",
message: "Ads will no longer be blocked.",
buttons: ["OK"],
});
if (!store.get("blockadsandtrackers") === "true") {
ElectronBlocker.fromPrebuiltAdsOnly(fetch).then((blocker) =>
blocker.disableBlockingInSession(
BrowserWindow.getFocusedWindow().webContents.session
)
);
}
return;
}
if (
store.get("blockads") === "false" ||
store.get("blockads") === undefined
) {
store.set("blockads", "true");
ElectronBlocker.fromPrebuiltAdsOnly(fetch).then((blocker) =>
blocker.enableBlockingInSession(
BrowserWindow.getFocusedWindow().webContents.session
)
);
dialog.showMessageBoxSync({
type: "info",
title: "Block Ads",
message: "Ads will now be blocked.",
buttons: ["OK"],
});
return;
}
},
checked: store.get("blockads") === "true",
},
{
label: "Block Ads and Trackers",
type: "checkbox",
click: () => {
if (store.get("blockadsandtrackers") === "true") {
store.set("blockadsandtrackers", "false");
dialog.showMessageBoxSync({
type: "info",
title: "Block Ads and Trackers",
message: "Ads and trackers will no longer be blocked.",
buttons: ["OK"],
});
if (!store.get("blockads") === "true") {
ElectronBlocker.fromPrebuiltAdsAndTracking(fetch).then(
(blocker) => {
blocker.disableBlockingInSession(
BrowserWindow.getFocusedWindow().webContents.session
);
}
);
}
return;
}
if (
store.get("blockadsandtrackers") === "false" ||
store.get("blockadsandtrackers") === undefined
) {
store.set("blockadsandtrackers", "true");
ElectronBlocker.fromPrebuiltAdsAndTracking(fetch).then(
(blocker) => {
blocker.enableBlockingInSession(
BrowserWindow.getFocusedWindow().webContents.session
);
dialog.showMessageBoxSync({
type: "info",
title: "Block Ads and Trackers",
message: "Ads and trackers will now be blocked.",
buttons: ["OK"],
});
}
);
return;
}
},
checked: store.get("blockadsandtrackers") === "true",
},
{ type: "separator" },
{
label: "Windows User-Agent String",
type: "radio",
click: () => {
setUserAgent(useragents.Windows);
},
checked: store.get("useragentstring") === useragents.Windows,
},
{
label: "macOS User-Agent String",
type: "radio",
click: () => {
setUserAgent(useragents.macOS);
},
checked: store.get("useragentstring") === useragents.macOS,
},
{
label: "Linux User-Agent String",
type: "radio",
click: () => {
store.set("useragentstring", useragents.Linux);
dialog.showMessageBoxSync({
type: "info",
title: "User agent switcher",
message:
"You have switched to Linux Useragent.\n\nPlease restart the app to apply the changes.",
buttons: ["OK"],
});
},
checked: store.get("useragentstring") === useragents.Linux,
},
{ type: "separator" },
...(!process.platform === "darwin"
? [
{
role: "quit",
accelerator: "Ctrl+Q",
},
]
: []),
],
},
{
label: "Navigation",
submenu: [
{
label: "Back",
click: () => {
BrowserWindow.getFocusedWindow().webContents.goBack();
},
},
{
label: "Forward",
click: () => {
BrowserWindow.getFocusedWindow().webContents.goForward();
},
},
{
label: "Reload",
click: () => {
BrowserWindow.getFocusedWindow().webContents.reload();
},
},
{
label: "Home",
click: () => {
BrowserWindow.getFocusedWindow().loadURL(
`${store.get("enterprise-or-normal")}`
);
},
},
],
},
{
label: "Edit",
submenu: [
{ role: "undo" },
{ role: "redo" },
{ type: "separator" },
{ role: "cut" },
{ role: "copy" },
{ role: "paste" },
...(process.platform === "darwin"
? [
{ role: "pasteAndMatchStyle" },
{ role: "delete" },
{ role: "selectAll" },
{ type: "separator" },
{
label: "Speech",
submenu: [{ role: "startSpeaking" }, { role: "stopSpeaking" }],
},
]
: [{ role: "delete" }, { type: "separator" }, { role: "selectAll" }]),
],
},
{
label: "View",
submenu: [
{ role: "reload" },
{ role: "forceReload" },
{ type: "separator" },
{ role: "resetZoom" },
{
role: "zoomIn",
accelerator: process.platform === "darwin" ? "Control+=" : "Control+=",
},
{ role: "zoomOut" },
{ type: "separator" },
{ role: "togglefullscreen" },
],
},
{
label: "Window",
submenu: [
{ role: "minimize" },
{ role: "zoom" },
...(process.platform === "darwin"
? [{ type: "separator" }, { role: "front" }, { type: "separator" }]
: [{ role: "close" }]),
...(!process.platform === "darwin"
? [
{ type: "separator" },
{
label: "Show Menu Bar",
type: "radio",
click: () => {
store.set("autohide-menubar", "false");
dialog.showMessageBoxSync({
type: "info",
title: "Menu Bar Settings",
message:
"Menu will be visible now. Please restart the app for changes to take effect.",
buttons: ["OK"],
});
},
checked: store.get("autohide-menubar") === "false",
},
{
label: "Hide Menu Bar (ALT to show)",
type: "radio",
click: () => {
store.set("autohide-menubar", "true");
dialog.showMessageBoxSync({
type: "info",
title: "Menu Bar Settings",
message:
"Menu bar will be automatically hidden now. Please restart the app for changes to take effect.",
buttons: ["OK"],
});
},
checked: store.get("autohide-menubar") === "true",
},
]
: []),
],
},
];
module.exports = { menulayout };

57
app/rpc.js Normal file
View File

@@ -0,0 +1,57 @@
const { Client } = require("@xhayper/discord-rpc");
const { dialog, BrowserWindow } = require("electron");
const client = new Client({
clientId: "942637872530460742",
});
async function clearActivity() {
await client.user?.clearActivity().catch((err) => {
dialog.showMessageBox(BrowserWindow.getFocusedWindow(), {
type: "error",
title: "Discord RPC Error",
message: "Oops! An Error occured while clearing Discord RPC.",
buttons: ["OK"],
});
});
}
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) => {
dialog.showMessageBox(BrowserWindow.getFocusedWindow(), {
type: "error",
title: "Discord RPC Error",
message: "Oops! An Error occured while setting Discord RPC.",
buttons: ["OK"],
});
console.error(err);
});
}
async function loginToRPC() {
await client.login().catch((err) => {
dialog.showMessageBox(BrowserWindow.getFocusedWindow(), {
type: "error",
title: "Discord RPC Error",
message: "Oops! An Error occured while connecting to Discord RPC.",
buttons: ["OK"],
});
console.error(err);
});
}
module.exports = {
clearActivity,
setActivity,
loginToRPC,
};

4
app/store.js Normal file
View File

@@ -0,0 +1,4 @@
const Store = require("electron-store");
const store = new Store();
module.exports = store;

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/111.0.0.0 Safari/537.36",
"macOS": "Mozilla/5.0 (Macintosh; Intel Mac OS X 13_2_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36",
"Linux": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"
}

BIN
assets/about.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 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: 159 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 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;
});

View File

@@ -1,118 +0,0 @@
/* browser.js v1.0 | @ajlkn | MIT licensed */
var browser = (function () {
"use strict";
var e = {
name: null,
version: null,
os: null,
osVersion: null,
touch: null,
mobile: null,
_canUse: null,
canUse: function (n) {
e._canUse || (e._canUse = document.createElement("div"));
var o = e._canUse.style,
r = n.charAt(0).toUpperCase() + n.slice(1);
return (
n in o ||
"Moz" + r in o ||
"Webkit" + r in o ||
"O" + r in o ||
"ms" + r in o
);
},
init: function () {
var n,
o,
r,
i,
t = navigator.userAgent;
for (
n = "other",
o = 0,
r = [
["firefox", /Firefox\/([0-9\.]+)/],
["bb", /BlackBerry.+Version\/([0-9\.]+)/],
["bb", /BB[0-9]+.+Version\/([0-9\.]+)/],
["opera", /OPR\/([0-9\.]+)/],
["opera", /Opera\/([0-9\.]+)/],
["edge", /Edge\/([0-9\.]+)/],
["safari", /Version\/([0-9\.]+).+Safari/],
["chrome", /Chrome\/([0-9\.]+)/],
["ie", /MSIE ([0-9]+)/],
["ie", /Trident\/.+rv:([0-9]+)/],
],
i = 0;
i < r.length;
i++
)
if (t.match(r[i][1])) {
(n = r[i][0]), (o = parseFloat(RegExp.$1));
break;
}
for (
e.name = n,
e.version = o,
n = "other",
o = 0,
r = [
[
"ios",
/([0-9_]+) like Mac OS X/,
function (e) {
return e.replace("_", ".").replace("_", "");
},
],
[
"ios",
/CPU like Mac OS X/,
function (e) {
return 0;
},
],
["wp", /Windows Phone ([0-9\.]+)/, null],
["android", /Android ([0-9\.]+)/, null],
[
"mac",
/Macintosh.+Mac OS X ([0-9_]+)/,
function (e) {
return e.replace("_", ".").replace("_", "");
},
],
["windows", /Windows NT ([0-9\.]+)/, null],
["bb", /BlackBerry.+Version\/([0-9\.]+)/, null],
["bb", /BB[0-9]+.+Version\/([0-9\.]+)/, null],
["linux", /Linux/, null],
["bsd", /BSD/, null],
["unix", /X11/, null],
],
i = 0;
i < r.length;
i++
)
if (t.match(r[i][1])) {
(n = r[i][0]),
(o = parseFloat(r[i][2] ? r[i][2](RegExp.$1) : RegExp.$1));
break;
}
(e.os = n),
(e.osVersion = o),
(e.touch =
"wp" == e.os
? navigator.msMaxTouchPoints > 0
: !!("ontouchstart" in window)),
(e.mobile =
"wp" == e.os || "android" == e.os || "ios" == e.os || "bb" == e.os);
},
};
return e.init(), e;
})();
!(function (e, n) {
"function" == typeof define && define.amd
? define([], n)
: "object" == typeof exports
? (module.exports = n())
: (e.browser = n());
})(this, function () {
return browser;
});

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