Add setting for external link handling

Introduced an option for users to open external links in their default browser rather than within the app. Enabled by default, can be configured in menu.

#240
This commit is contained in:
Agampreet Singh
2024-08-09 18:24:35 +05:30
parent 0066e6c5d0
commit c2c91002d2
4 changed files with 194 additions and 17 deletions

View File

@@ -454,6 +454,20 @@ const commonPreferencesSubmenu = [
},
checked: getValue("blockadsandtrackers") === "true",
},
{
label: "Open External Links in Default Browser",
type: "checkbox",
click: () => {
setValue("externalLinks", getValue("externalLinks") === "true" ? "false" : "true");
dialog.showMessageBoxSync({
type: "info",
title: "External Links in Default Browser",
message: `External links will now open in ${getValue("externalLinks") === "true" ? "your default browser" : "MS-365-Electron"}`,
buttons: ["OK"],
});
},
checked: getValue("externalLinks") === "true",
},
{ type: "separator" },
{
label: "Windows User-Agent String",

View File

@@ -33,6 +33,7 @@ getValueOrDefault("windowWidth", 0.71);
getValueOrDefault("windowHeight", 0.74);
getValueOrDefault("customWindowSize", false);
getValueOrDefault("aptabaseTracking", null);
getValueOrDefault("externalLinks", "true");
if (getValue("enterprise-or-normal") === "https://microsoft365.com/?auth=1") {
setValue("enterprise-or-normal", "?auth=1");