mirror of
https://github.com/agam778/MS-365-Electron.git
synced 2026-02-17 09:02:10 +00:00
Use URL to check which website is opened
This commit is contained in:
28
app/main.js
28
app/main.js
@@ -168,8 +168,8 @@ app.on("web-contents-created", (event, contents) => {
|
||||
contents.on("did-finish-load", () => {
|
||||
if (
|
||||
BrowserWindow.getFocusedWindow()
|
||||
.webContents.getTitle()
|
||||
.includes("Microsoft PowerPoint")
|
||||
.webContents.getURL()
|
||||
.includes("&ithint=file%2cpptx")
|
||||
) {
|
||||
if (process.platform === "darwin") {
|
||||
app.dock.setIcon(
|
||||
@@ -185,8 +185,8 @@ app.on("web-contents-created", (event, contents) => {
|
||||
}
|
||||
} else if (
|
||||
BrowserWindow.getFocusedWindow()
|
||||
.webContents.getTitle()
|
||||
.includes("Microsoft Word")
|
||||
.webContents.getURL()
|
||||
.includes("&ithint=file%2cdocx")
|
||||
) {
|
||||
if (process.platform === "darwin") {
|
||||
app.dock.setIcon(
|
||||
@@ -202,8 +202,8 @@ app.on("web-contents-created", (event, contents) => {
|
||||
}
|
||||
} else if (
|
||||
BrowserWindow.getFocusedWindow()
|
||||
.webContents.getTitle()
|
||||
.includes("Microsoft Excel")
|
||||
.webContents.getURL()
|
||||
.includes("&ithint=file%2cxlsx")
|
||||
) {
|
||||
if (process.platform === "darwin") {
|
||||
app.dock.setIcon(
|
||||
@@ -219,8 +219,8 @@ app.on("web-contents-created", (event, contents) => {
|
||||
}
|
||||
} else if (
|
||||
BrowserWindow.getFocusedWindow()
|
||||
.webContents.getTitle()
|
||||
.includes("Outlook")
|
||||
.webContents.getURL()
|
||||
.includes("outlook.live.com")
|
||||
) {
|
||||
if (process.platform === "darwin") {
|
||||
app.dock.setIcon(
|
||||
@@ -236,8 +236,8 @@ app.on("web-contents-created", (event, contents) => {
|
||||
}
|
||||
} else if (
|
||||
BrowserWindow.getFocusedWindow()
|
||||
.webContents.getTitle()
|
||||
.includes("OneDrive")
|
||||
.webContents.getURL()
|
||||
.includes("onedrive.live.com")
|
||||
) {
|
||||
if (process.platform === "darwin") {
|
||||
app.dock.setIcon(
|
||||
@@ -253,8 +253,8 @@ app.on("web-contents-created", (event, contents) => {
|
||||
}
|
||||
} else if (
|
||||
BrowserWindow.getFocusedWindow()
|
||||
.webContents.getTitle()
|
||||
.includes("Microsoft Teams")
|
||||
.webContents.getURL()
|
||||
.includes("teams.live.com")
|
||||
) {
|
||||
if (process.platform === "darwin") {
|
||||
app.dock.setIcon(
|
||||
@@ -270,8 +270,8 @@ app.on("web-contents-created", (event, contents) => {
|
||||
}
|
||||
} else if (
|
||||
BrowserWindow.getFocusedWindow()
|
||||
.webContents.getTitle()
|
||||
.includes("Microsoft OneNote Online")
|
||||
.webContents.getURL()
|
||||
.includes("&ithint=onenote")
|
||||
) {
|
||||
if (process.platform === "darwin") {
|
||||
app.dock.setIcon(
|
||||
|
||||
Reference in New Issue
Block a user