camoufox-js 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addons.js +5 -0
- package/package.json +1 -1
package/dist/addons.js
CHANGED
|
@@ -2,6 +2,7 @@ import { InvalidAddonPath } from './exceptions.js';
|
|
|
2
2
|
import { getPath, unzip, webdl } from './pkgman.js';
|
|
3
3
|
import fs from 'fs';
|
|
4
4
|
import { join } from 'path';
|
|
5
|
+
import { getAsBooleanFromENV } from './utils.js';
|
|
5
6
|
export const DefaultAddons = {
|
|
6
7
|
/**
|
|
7
8
|
* Default addons to be downloaded
|
|
@@ -47,6 +48,10 @@ function getAddonPath(addonName) {
|
|
|
47
48
|
* Skips downloading if the addon is already downloaded
|
|
48
49
|
*/
|
|
49
50
|
export function maybeDownloadAddons(addons, addonsList = []) {
|
|
51
|
+
if (getAsBooleanFromENV('PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD', false)) {
|
|
52
|
+
console.log("Skipping addon download due to PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD set!");
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
50
55
|
for (const addonName in addons) {
|
|
51
56
|
const addonPath = getAddonPath(addonName);
|
|
52
57
|
if (fs.existsSync(addonPath)) {
|