mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
chromium importer working in sandbox
This commit is contained in:
1
apps/desktop/desktop_native/napi/index.d.ts
vendored
1
apps/desktop/desktop_native/napi/index.d.ts
vendored
@@ -249,6 +249,7 @@ export declare namespace chromium_importer {
|
||||
export function getMetadata(): Record<string, NativeImporterMetadata>
|
||||
export function getAvailableProfiles(browser: string): Array<ProfileInfo>
|
||||
export function importLogins(browser: string, profileId: string): Promise<Array<LoginImportResult>>
|
||||
export function requestBrowserAccess(browser: string): void
|
||||
}
|
||||
export declare namespace autotype {
|
||||
export function getForegroundWindowTitle(): string
|
||||
|
||||
@@ -11,7 +11,12 @@ if (isRelease) {
|
||||
process.env.RUST_LOG = 'debug';
|
||||
}
|
||||
|
||||
execSync(`napi build --platform --js false`, { stdio: 'inherit', env: process.env });
|
||||
const featuresArg = process.env.SANDBOX_BUILD === '1' ? '--features sandbox' : '';
|
||||
if (featuresArg) {
|
||||
console.log('Building with sandbox feature enabled.');
|
||||
}
|
||||
|
||||
execSync(`napi build --platform --js false ${featuresArg}`, { stdio: 'inherit', env: process.env });
|
||||
|
||||
|
||||
/* Mac App Store build with sandboxing - Does this belong here?
|
||||
|
||||
@@ -1182,11 +1182,18 @@ pub mod chromium_importer {
|
||||
.map_err(|e| napi::Error::from_reason(e.to_string()))
|
||||
}
|
||||
|
||||
#[cfg_attr(all(target_os = "macos", feature = "sandbox"), napi)]
|
||||
#[cfg(all(target_os = "macos", feature = "sandbox"))]
|
||||
#[napi]
|
||||
pub fn request_browser_access(browser: String) -> napi::Result<()> {
|
||||
chromium_importer::chromium::request_browser_access(&browser)
|
||||
.map_err(|e| napi::Error::from_reason(e.to_string()))
|
||||
#[cfg(all(target_os = "macos", feature = "sandbox"))]
|
||||
{
|
||||
chromium_importer::chromium::request_browser_access(&browser)
|
||||
.map_err(|e| napi::Error::from_reason(e.to_string()))
|
||||
}
|
||||
#[cfg(not(all(target_os = "macos", feature = "sandbox")))]
|
||||
{
|
||||
// No-op when built without sandbox feature
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user