mirror of
https://github.com/bitwarden/browser
synced 2025-12-29 14:43:31 +00:00
remove sandbox feature flag and refactor to use bool
This commit is contained in:
@@ -12,7 +12,6 @@ crate-type = ["cdylib"]
|
||||
[features]
|
||||
default = []
|
||||
manual_test = []
|
||||
sandbox = ["chromium_importer/sandbox"]
|
||||
|
||||
[dependencies]
|
||||
anyhow = { workspace = true }
|
||||
|
||||
4
apps/desktop/desktop_native/napi/index.d.ts
vendored
4
apps/desktop/desktop_native/napi/index.d.ts
vendored
@@ -255,8 +255,8 @@ export declare namespace chromium_importer {
|
||||
/** Returns OS aware metadata describing supported Chromium based importers as a JSON string. */
|
||||
export function getMetadata(masBuild: boolean): 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 function importLogins(browser: string, profileId: string, masBuild: boolean): Promise<Array<LoginImportResult>>
|
||||
export function requestBrowserAccess(browser: string, masBuild: boolean): void
|
||||
}
|
||||
export declare namespace autotype {
|
||||
export function getForegroundWindowTitle(): string
|
||||
|
||||
@@ -11,9 +11,4 @@ if (isRelease) {
|
||||
process.env.RUST_LOG = 'debug';
|
||||
}
|
||||
|
||||
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 });
|
||||
execSync(`napi build --platform --js false`, { stdio: 'inherit', env: process.env });
|
||||
|
||||
@@ -1186,24 +1186,24 @@ pub mod chromium_importer {
|
||||
pub async fn import_logins(
|
||||
browser: String,
|
||||
profile_id: String,
|
||||
mas_build: bool,
|
||||
) -> napi::Result<Vec<LoginImportResult>> {
|
||||
chromium_importer::chromium::import_logins(&browser, &profile_id)
|
||||
chromium_importer::chromium::import_logins(&browser, &profile_id, mas_build)
|
||||
.await
|
||||
.map(|logins| logins.into_iter().map(LoginImportResult::from).collect())
|
||||
.map_err(|e| napi::Error::from_reason(e.to_string()))
|
||||
}
|
||||
|
||||
#[napi]
|
||||
#[allow(unused_variables)]
|
||||
pub fn request_browser_access(browser: String) -> napi::Result<()> {
|
||||
#[cfg(all(target_os = "macos", feature = "sandbox"))]
|
||||
pub fn request_browser_access(browser: String, mas_build: bool) -> napi::Result<()> {
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
chromium_importer::chromium::request_browser_access(&browser)
|
||||
chromium_importer::chromium::request_browser_access(&browser, mas_build)
|
||||
.map_err(|e| napi::Error::from_reason(e.to_string()))
|
||||
}
|
||||
#[cfg(not(all(target_os = "macos", feature = "sandbox")))]
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
{
|
||||
// No-op when built without sandbox feature
|
||||
// No-op outside of Mac OS
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user