Skip to content

Commit 12c8779

Browse files
authored
Browser: Revert to old headless mode (#459)
* Puppeteer: Revert to old headless mode * disable warning
1 parent 436f614 commit 12c8779

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/app.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ async function main() {
1515
const env = Object.assign({}, process.env);
1616
const command = argv._[0];
1717

18+
// See https://github.com/grafana/grafana-image-renderer/issues/460
19+
process.env["PUPPETEER_DISABLE_HEADLESS_WARNING"] = "true"
20+
1821
if (command === undefined) {
1922
const logger = new PluginLogger();
2023
const config: PluginConfig = defaultPluginConfig;
@@ -24,7 +27,7 @@ async function main() {
2427
const chromeInfoFile = fs.readFileSync(path.resolve(execPath, 'chrome-info.json'), 'utf8');
2528
const chromeInfo = JSON.parse(chromeInfoFile);
2629

27-
config.rendering.chromeBin = computeExecutablePath({
30+
config.rendering.chromeBin = computeExecutablePath({
2831
cacheDir: path.dirname(process.execPath),
2932
browser: Browser.CHROME,
3033
buildId: chromeInfo.buildId,

src/browser/browser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export class Browser {
135135
launcherOptions.executablePath = this.config.chromeBin;
136136
}
137137

138-
launcherOptions.headless = !this.config.headed ? "new" : false;
138+
launcherOptions.headless = !this.config.headed;
139139

140140
return launcherOptions;
141141
}

0 commit comments

Comments
 (0)