mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 17:23:37 +00:00
[PM-13099] Enable browserintegration on dmg builds on adding an env variable (#11359)
* Enable browserintegration on dmg builds on adding an env variable * Fix crash * Cleanup
This commit is contained in:
@@ -632,43 +632,51 @@ export class SettingsComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async saveBrowserIntegration() {
|
async saveBrowserIntegration() {
|
||||||
if (
|
const skipSupportedPlatformCheck =
|
||||||
ipc.platform.deviceType === DeviceType.MacOsDesktop &&
|
ipc.platform.allowBrowserintegrationOverride || ipc.platform.isDev;
|
||||||
!this.platformUtilsService.isMacAppStore() &&
|
|
||||||
!ipc.platform.isDev
|
|
||||||
) {
|
|
||||||
await this.dialogService.openSimpleDialog({
|
|
||||||
title: { key: "browserIntegrationUnsupportedTitle" },
|
|
||||||
content: { key: "browserIntegrationMasOnlyDesc" },
|
|
||||||
acceptButtonText: { key: "ok" },
|
|
||||||
cancelButtonText: null,
|
|
||||||
type: "warning",
|
|
||||||
});
|
|
||||||
|
|
||||||
this.form.controls.enableBrowserIntegration.setValue(false);
|
if (skipSupportedPlatformCheck) {
|
||||||
return;
|
if (
|
||||||
} else if (ipc.platform.isWindowsStore) {
|
ipc.platform.deviceType === DeviceType.MacOsDesktop &&
|
||||||
await this.dialogService.openSimpleDialog({
|
!this.platformUtilsService.isMacAppStore()
|
||||||
title: { key: "browserIntegrationUnsupportedTitle" },
|
) {
|
||||||
content: { key: "browserIntegrationWindowsStoreDesc" },
|
await this.dialogService.openSimpleDialog({
|
||||||
acceptButtonText: { key: "ok" },
|
title: { key: "browserIntegrationUnsupportedTitle" },
|
||||||
cancelButtonText: null,
|
content: { key: "browserIntegrationMasOnlyDesc" },
|
||||||
type: "warning",
|
acceptButtonText: { key: "ok" },
|
||||||
});
|
cancelButtonText: null,
|
||||||
|
type: "warning",
|
||||||
|
});
|
||||||
|
|
||||||
this.form.controls.enableBrowserIntegration.setValue(false);
|
this.form.controls.enableBrowserIntegration.setValue(false);
|
||||||
return;
|
return;
|
||||||
} else if (ipc.platform.isSnapStore || ipc.platform.isFlatpak) {
|
}
|
||||||
await this.dialogService.openSimpleDialog({
|
|
||||||
title: { key: "browserIntegrationUnsupportedTitle" },
|
|
||||||
content: { key: "browserIntegrationLinuxDesc" },
|
|
||||||
acceptButtonText: { key: "ok" },
|
|
||||||
cancelButtonText: null,
|
|
||||||
type: "warning",
|
|
||||||
});
|
|
||||||
|
|
||||||
this.form.controls.enableBrowserIntegration.setValue(false);
|
if (ipc.platform.isWindowsStore) {
|
||||||
return;
|
await this.dialogService.openSimpleDialog({
|
||||||
|
title: { key: "browserIntegrationUnsupportedTitle" },
|
||||||
|
content: { key: "browserIntegrationWindowsStoreDesc" },
|
||||||
|
acceptButtonText: { key: "ok" },
|
||||||
|
cancelButtonText: null,
|
||||||
|
type: "warning",
|
||||||
|
});
|
||||||
|
|
||||||
|
this.form.controls.enableBrowserIntegration.setValue(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ipc.platform.isSnapStore || ipc.platform.isFlatpak) {
|
||||||
|
await this.dialogService.openSimpleDialog({
|
||||||
|
title: { key: "browserIntegrationUnsupportedTitle" },
|
||||||
|
content: { key: "browserIntegrationLinuxDesc" },
|
||||||
|
acceptButtonText: { key: "ok" },
|
||||||
|
cancelButtonText: null,
|
||||||
|
type: "warning",
|
||||||
|
});
|
||||||
|
|
||||||
|
this.form.controls.enableBrowserIntegration.setValue(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.desktopSettingsService.setBrowserIntegrationEnabled(
|
await this.desktopSettingsService.setBrowserIntegrationEnabled(
|
||||||
|
|||||||
@@ -11,7 +11,15 @@ import {
|
|||||||
Message,
|
Message,
|
||||||
UnencryptedMessageResponse,
|
UnencryptedMessageResponse,
|
||||||
} from "../models/native-messaging";
|
} from "../models/native-messaging";
|
||||||
import { isAppImage, isDev, isFlatpak, isMacAppStore, isSnapStore, isWindowsStore } from "../utils";
|
import {
|
||||||
|
allowBrowserintegrationOverride,
|
||||||
|
isAppImage,
|
||||||
|
isDev,
|
||||||
|
isFlatpak,
|
||||||
|
isMacAppStore,
|
||||||
|
isSnapStore,
|
||||||
|
isWindowsStore,
|
||||||
|
} from "../utils";
|
||||||
|
|
||||||
import { ClipboardWriteMessage } from "./types/clipboard";
|
import { ClipboardWriteMessage } from "./types/clipboard";
|
||||||
|
|
||||||
@@ -140,6 +148,7 @@ export default {
|
|||||||
isFlatpak: isFlatpak(),
|
isFlatpak: isFlatpak(),
|
||||||
isSnapStore: isSnapStore(),
|
isSnapStore: isSnapStore(),
|
||||||
isAppImage: isAppImage(),
|
isAppImage: isAppImage(),
|
||||||
|
allowBrowserintegrationOverride: allowBrowserintegrationOverride(),
|
||||||
reloadProcess: () => ipcRenderer.send("reload-process"),
|
reloadProcess: () => ipcRenderer.send("reload-process"),
|
||||||
focusWindow: () => ipcRenderer.send("window-focus"),
|
focusWindow: () => ipcRenderer.send("window-focus"),
|
||||||
hideWindow: () => ipcRenderer.send("window-hide"),
|
hideWindow: () => ipcRenderer.send("window-hide"),
|
||||||
|
|||||||
@@ -70,6 +70,16 @@ export function isWindowsPortable() {
|
|||||||
return isWindows() && process.env.PORTABLE_EXECUTABLE_DIR != null;
|
return isWindows() && process.env.PORTABLE_EXECUTABLE_DIR != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* We block the browser integration on some unsupported platforms, which also
|
||||||
|
* blocks partially supported platforms (mac .dmg in dev builds) / prevents
|
||||||
|
* experimenting with the feature for QA. So this env var allows overriding
|
||||||
|
* the block.
|
||||||
|
*/
|
||||||
|
export function allowBrowserintegrationOverride() {
|
||||||
|
return process.env.ALLOW_BROWSER_INTEGRATION_OVERRIDE === "true";
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sanitize user agent so external resources used by the app can't built data on our users.
|
* Sanitize user agent so external resources used by the app can't built data on our users.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user