Compare commits

..

6 Commits

Author SHA1 Message Date
190d57bbe2 1.0.14 2019-11-16 17:51:13 +01:00
8d4519d615 fix(cli logs): now correctly stating when WSL is detected. 2019-11-16 17:51:11 +01:00
42a68434c0 1.0.13 2019-11-16 01:22:10 +01:00
35fd4678d1 fix(core): update 2019-11-16 01:22:08 +01:00
01a4122529 1.0.12 2019-11-16 01:15:10 +01:00
fbb94fe51e fix(core): update 2019-11-16 01:15:08 +01:00
5 changed files with 12 additions and 11 deletions

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartpuppeteer", "name": "@pushrocks/smartpuppeteer",
"version": "1.0.11", "version": "1.0.14",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartpuppeteer", "name": "@pushrocks/smartpuppeteer",
"version": "1.0.11", "version": "1.0.14",
"private": false, "private": false,
"description": "simplified access to puppeteer", "description": "simplified access to puppeteer",
"main": "dist/index.js", "main": "dist/index.js",

View File

@@ -18,10 +18,14 @@ simplified access to puppeteer
## Usage ## Usage
## Contribution Use TypeScript for best in class intellisense.
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
```typescript
const headlessBrowser = await smartpuppeteer.getEnvAwareBrowserInstance({
forceNoSandbox: true // if you really want no sandbox, you can do this. Otherwise its starting things as necessary
});
await headlessBrowser.close();
```
## Contribution ## Contribution

View File

@@ -1,7 +1,7 @@
import { expect, tap } from '@pushrocks/tapbundle'; import { expect, tap } from '@pushrocks/tapbundle';
import * as smartpuppeteer from '../ts/index'; import * as smartpuppeteer from '../ts/index';
tap.test('first test', async (tools) => { tap.test('first test', async tools => {
const headlessBrowser = await smartpuppeteer.getEnvAwareBrowserInstance({ const headlessBrowser = await smartpuppeteer.getEnvAwareBrowserInstance({
forceNoSandbox: true forceNoSandbox: true
}); });

View File

@@ -19,11 +19,8 @@ export const getEnvAwareBrowserInstance = async (
if ((process.env.CI || options.forceNoSandbox) && !smartenv.isWsl) { if ((process.env.CI || options.forceNoSandbox) && !smartenv.isWsl) {
chromeArgs = chromeArgs.concat(['--no-sandbox', '--disable-setuid-sandbox']); chromeArgs = chromeArgs.concat(['--no-sandbox', '--disable-setuid-sandbox']);
} else if (smartenv.isWsl) { } else if (smartenv.isWsl) {
console.log('Detected WSL. Using chromium.'); console.log('Detected WSL.');
chromeArgs = chromeArgs.concat([ chromeArgs = chromeArgs.concat(['--no-sandbox', '--single-process']);
'--no-sandbox',
'--single-process'
]);
} }
let headlessBrowser: plugins.puppeteer.Browser; let headlessBrowser: plugins.puppeteer.Browser;