Commit 5f6d2e58 authored by 张辰's avatar 张辰

1

parent c998ca17
......@@ -35,17 +35,19 @@ public class PagePdfGenUtils {
});
t.start();
}
// ArrayList<String> argList = new ArrayList<>();
// LaunchOptions options = new LaunchOptionsBuilder()
// .withExecutablePath("/usr/bin/google-chrome")
// .withArgs(argList)
// .withHeadless(true)
// .build();
//
// argList.add("--no-sandbox");
// argList.add("--disable-setuid-sandbox");
// argList.add("--enable-logging=/data/logs/chrome22.log --v=1");
// browser = Puppeteer.launch(options);
ArrayList<String> argList = new ArrayList<>();
LaunchOptions options = new LaunchOptionsBuilder()
.withExecutablePath("/usr/bin/google-chrome")
.withArgs(argList)
.withHeadless(true)
.build();
argList.add("--no-sandbox");
argList.add("--disable-setuid-sandbox");
argList.add("--enable-logging=/data/logs/chrome22.log --v=1");
browser = Puppeteer.launch(options);
isBrowserClosed = false;
} catch (Throwable t) {
log.error("error in init genPdf", t);
......@@ -54,18 +56,18 @@ public class PagePdfGenUtils {
public static void genPdf(String url) throws Throwable {
ArrayList<String> argList = new ArrayList<>();
LaunchOptions options = new LaunchOptionsBuilder()
.withExecutablePath("/usr/bin/google-chrome")
.withArgs(argList)
.withHeadless(true)
.build();
argList.add("--no-sandbox");
argList.add("--disable-setuid-sandbox");
argList.add("--enable-logging=/data/logs/chrome.log");
argList.add("--v=2");
browser = Puppeteer.launch(options);
// ArrayList<String> argList = new ArrayList<>();
// LaunchOptions options = new LaunchOptionsBuilder()
// .withExecutablePath("/usr/bin/google-chrome")
// .withArgs(argList)
// .withHeadless(true)
// .build();
//
// argList.add("--no-sandbox");
// argList.add("--disable-setuid-sandbox");
// argList.add("--enable-logging=/data/logs/chrome.log");
// argList.add("--v=2");
// browser = Puppeteer.launch(options);
Page page = browser.newPage();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment