1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 21:33:27 +00:00

remove additional debug output and revert popup-modal-style to match main

This commit is contained in:
John Harrington
2025-11-21 08:12:34 -07:00
parent 83c01ba9bf
commit 4be25d9290
3 changed files with 9 additions and 45 deletions

View File

@@ -3,7 +3,7 @@
### TLDR
#### Build & run locally using `npm run electron:sandbox`
#### `build-desktop.yml` section `macos-package-mas` was modified:
#### `build-desktop.yml` section `macos-package-mas` was modified to support this in CI builds:
```
- name: Build Native Module
if: steps.cache.outputs.cache-hit != 'true'

View File

@@ -1,4 +1,3 @@
/* eslint-disable no-console */
import { CommonModule } from "@angular/common";
import { Component } from "@angular/core";
@@ -55,17 +54,8 @@ export class ImportDesktopComponent {
private async _onLoadProfilesFromBrowser(
browser: string,
): Promise<chromium_importer.ProfileInfo[]> {
console.log("[SANDBOX] onLoadProfilesFromBrowser called for:", browser);
// Request browser access (required for sandboxed builds, no-op otherwise)
try {
console.log("[SANDBOX] Calling requestBrowserAccess...");
await ipc.tools.chromiumImporter.requestBrowserAccess(browser);
console.log("[SANDBOX] requestBrowserAccess completed successfully");
} catch (error) {
console.error("[SANDBOX] requestBrowserAccess failed:", error);
throw error;
}
console.log("[SANDBOX] Calling getAvailableProfiles...");
await ipc.tools.chromiumImporter.requestBrowserAccess(browser);
return ipc.tools.chromiumImporter.getAvailableProfiles(browser);
}

View File

@@ -42,40 +42,14 @@ function positionWindow(window: BrowserWindow, position?: Position) {
export function applyMainWindowStyles(window: BrowserWindow, existingWindowState: WindowState) {
window.setMinimumSize(680, 500);
// need to guard against null/undefined values and ensure values are valid
if (existingWindowState) {
if (
typeof existingWindowState.width === "number" &&
typeof existingWindowState.height === "number" &&
Number.isFinite(existingWindowState.width) &&
Number.isFinite(existingWindowState.height) &&
existingWindowState.width > 0 &&
existingWindowState.height > 0
) {
try {
// Ensure values are integers as Electron expects integer pixel values
window.setSize(
Math.round(existingWindowState.width),
Math.round(existingWindowState.height),
);
} catch {
// Silently fail - window will use default size
}
}
// need to guard against null/undefined values
if (
typeof existingWindowState.x === "number" &&
typeof existingWindowState.y === "number" &&
Number.isFinite(existingWindowState.x) &&
Number.isFinite(existingWindowState.y)
) {
try {
// Ensure values are integers as Electron expects integer pixel values
window.setPosition(Math.round(existingWindowState.x), Math.round(existingWindowState.y));
} catch {
// Silently fail - window will use default position
}
}
if (existingWindowState?.width && existingWindowState?.height) {
window.setSize(Math.floor(existingWindowState.width), Math.floor(existingWindowState.height));
}
if (existingWindowState?.x && existingWindowState?.y) {
window.setPosition(Math.floor(existingWindowState.x), Math.floor(existingWindowState.y));
}
window.setWindowButtonVisibility?.(true);