Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify startup params #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"license": "MIT",
"scripts": {
"tradition": "node tradition/index.js",
"pupp": "node pupp.js"
"pupp:dev": "NODE_ENV=dev node pupp.js",
"pupp:prod": "NODE_ENV=prod node pupp.js"
},
"dependencies": {
"axios": "^0.19.0",
Expand Down
15 changes: 14 additions & 1 deletion pupp.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,20 @@ const main = async () => {
return console.log(">>>>>>>> 先改个账号密码再来吧");

const start = performance.now();
const browser = await puppeteer.launch({ headless: false });
const browser = await puppeteer.launch({
headless: process.env.NODE_ENV === "dev" ? false : true,
ignoreHTTPSErrors: true,
args: [
"--disable-web-security",
"--disable-setuid-sandbox",
"--no-sandbox",
"--disable-gpu",
"--disable-dev-shm-usage",
"--no-first-run",
"--no-zygote",
"--disable-popup-blocking"
]
});

const page = await browser.newPage();
await page._client.send("Network.clearBrowserCookies");
Expand Down