From 15d339d7f902298f34c3291ba7166e182ae7a5ac Mon Sep 17 00:00:00 2001 From: Agampreet Singh <68941022+agam778@users.noreply.github.com> Date: Sun, 11 Jun 2023 21:00:20 +0530 Subject: [PATCH] Add OneDrive option under Apps menu --- app/menu.js | 74 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 62 insertions(+), 12 deletions(-) diff --git a/app/menu.js b/app/menu.js index b1ce70a..1e7d51f 100644 --- a/app/menu.js +++ b/app/menu.js @@ -481,10 +481,10 @@ const menulayout = [ contextIsolation: true, }, }); - wordwindow.loadURL("https://office.com/launch/word?auth=2"); + wordwindow.loadURL("https://microsoft365.com/launch/word?auth=2"); } else { BrowserWindow.getFocusedWindow().loadURL( - "https://office.com/launch/word?auth=2" + "https://microsoft365.com/launch/word?auth=2" ); } } else if ( @@ -500,10 +500,10 @@ const menulayout = [ contextIsolation: true, }, }); - wordwindow.loadURL("https://office.com/launch/word?auth=1"); + wordwindow.loadURL("https://microsoft365.com/launch/word?auth=1"); } else { BrowserWindow.getFocusedWindow().loadURL( - "https://office.com/launch/word?auth=1" + "https://microsoft365.com/launch/word?auth=1" ); } } @@ -525,10 +525,12 @@ const menulayout = [ contextIsolation: true, }, }); - excelwindow.loadURL("https://office.com/launch/excel?auth=2"); + excelwindow.loadURL( + "https://microsoft365.com/launch/excel?auth=2" + ); } else { BrowserWindow.getFocusedWindow().loadURL( - "https://office.com/launch/excel?auth=2" + "https://microsoft365.com/launch/excel?auth=2" ); } } else if ( @@ -544,10 +546,12 @@ const menulayout = [ contextIsolation: true, }, }); - excelwindow.loadURL("https://office.com/launch/excel?auth=1"); + excelwindow.loadURL( + "https://microsoft365.com/launch/excel?auth=1" + ); } else { BrowserWindow.getFocusedWindow().loadURL( - "https://office.com/launch/excel?auth=1" + "https://microsoft365.com/launch/excel?auth=1" ); } } @@ -570,11 +574,11 @@ const menulayout = [ }, }); powerpointwindow.loadURL( - "https://office.com/launch/powerpoint?auth=2" + "https://microsoft365.com/launch/powerpoint?auth=2" ); } else { BrowserWindow.getFocusedWindow().loadURL( - "https://office.com/launch/powerpoint?auth=2" + "https://microsoft365.com/launch/powerpoint?auth=2" ); } } else if ( @@ -591,11 +595,11 @@ const menulayout = [ }, }); powerpointwindow.loadURL( - "https://office.com/launch/powerpoint?auth=1" + "https://microsoft365.com/launch/powerpoint?auth=1" ); } else { BrowserWindow.getFocusedWindow().loadURL( - "https://office.com/launch/powerpoint?auth=1" + "https://microsoft365.com/launch/powerpoint?auth=1" ); } } @@ -647,6 +651,52 @@ const menulayout = [ } }, }, + { + label: "OneDrive", + click: () => { + if ( + store.get("enterprise-or-normal") === + "https://microsoft365.com/?auth=2" + ) { + if (store.get("websites-in-new-window") === "true") { + let onedrivewindow = new BrowserWindow({ + width: 800, + height: 600, + webPreferences: { + nodeIntegration: false, + contextIsolation: true, + }, + }); + onedrivewindow.loadURL( + "https://microsoft365.com/launch/onedrive?auth=2" + ); + } else { + BrowserWindow.getFocusedWindow().loadURL( + "https://microsoft365.com/launch/onedrive?auth=2" + ); + } + } else if ( + store.get("enterprise-or-normal") === + "https://microsoft365.com/?auth=1" + ) { + if (store.get("websites-in-new-window") === "true") { + let onedrivewindow = new BrowserWindow({ + width: 800, + height: 600, + webPreferences: { + nodeIntegration: false, + contextIsolation: true, + }, + }); + onedrivewindow.loadURL("https://microsoft365.com/launch/onedrive?auth=1"); + } else { + BrowserWindow.getFocusedWindow().loadURL( + "https://microsoft365.com/launch/onedrive?auth=1" + ); + } + } + }, + }, { label: "OneNote", click: () => {