m365connector 0.3.7 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/browser-session.js +13 -1
package/package.json
CHANGED
package/src/browser-session.js
CHANGED
|
@@ -70,11 +70,23 @@ function requestText(url, options = {}) {
|
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
function findEdgeExecutable() {
|
|
73
|
+
export function findEdgeExecutable() {
|
|
74
74
|
if (process.env.M365C_EDGE_PATH) {
|
|
75
75
|
return expandHome(process.env.M365C_EDGE_PATH);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
if (process.platform === "win32") {
|
|
79
|
+
const programFiles = process.env["ProgramFiles"] || "C:\\Program Files";
|
|
80
|
+
const programFilesX86 = process.env["ProgramFiles(x86)"] || "C:\\Program Files (x86)";
|
|
81
|
+
const localAppData = process.env.LOCALAPPDATA || path.join(os.homedir(), "AppData", "Local");
|
|
82
|
+
const winCandidates = [
|
|
83
|
+
path.join(programFilesX86, "Microsoft", "Edge", "Application", "msedge.exe"),
|
|
84
|
+
path.join(programFiles, "Microsoft", "Edge", "Application", "msedge.exe"),
|
|
85
|
+
path.join(localAppData, "Microsoft", "Edge", "Application", "msedge.exe")
|
|
86
|
+
];
|
|
87
|
+
return winCandidates.find((candidate) => fs.existsSync(candidate)) || "msedge.exe";
|
|
88
|
+
}
|
|
89
|
+
|
|
78
90
|
const candidates = [
|
|
79
91
|
"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",
|
|
80
92
|
path.join(os.homedir(), "Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"),
|