mirror of
https://github.com/CloakHQ/CloakBrowser.git
synced 2026-06-23 11:41:46 +02:00
feat: add extension_paths parameter for loading Chrome extensions (#210)
Add `extension_paths` parameter to all launch functions (Python + JS) for loading Chrome extensions. Resolves paths to absolute, injects `--load-extension` and `--disable-extensions-except` flags via `build_args()`. Note: Extensions require a persistent context (`launch_persistent_context`) to function — this is a Chromium limitation. Co-authored-by: zackycodes <75211659+zackycodes@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import path from "path";
|
||||
import { _buildArgsForTest } from "../src/playwright.js";
|
||||
|
||||
test("extension paths inject chrome flags", () => {
|
||||
const args = _buildArgsForTest({
|
||||
extensionPaths: ["./ext"],
|
||||
});
|
||||
|
||||
const abs = path.resolve("./ext");
|
||||
|
||||
expect(args).toContain(`--load-extension=${abs}`);
|
||||
|
||||
expect(args).toContain(
|
||||
`--disable-extensions-except=${abs}`
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user