Skip to content

Commit

Permalink
Merge pull request #78 from marp-team/fix-bgpt-preview
Browse files Browse the repository at this point in the history
Fix to work Chrome's BGPT feature in preview window
  • Loading branch information
yhatt authored Mar 19, 2019
2 parents d9ed1ef + 01a728c commit 0bf9943
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

### Added

- [Direction keyword](https://marpit.marp.app/image-syntax?id=direction-keyword) for background images, from [Marpit v0.8.0](https://github.com/marp-team/marpit/releases/v0.8.0) ([#77](https://github.com/marp-team/marp-core/pull/77))
- [Direction keyword](https://marpit.marp.app/image-syntax?id=direction-keyword) for background images, from [Marpit v0.8.0](https://github.com/marp-team/marpit/releases/v0.8.0) ([#77](https://github.com/marp-team/marp-cli/pull/77))

### Fixed

- Fix to work Chrome's BGPT feature in preview window ([#78](https://github.com/marp-team/marp-cli/pull/78))

### Changed

Expand Down
16 changes: 12 additions & 4 deletions src/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,19 @@ export class Preview extends TypedEventEmitter<Preview.Events> {
}

private async launch() {
const args = ['--enable-blink-gen-property-trees']
if (process.env.CI) args.push('--disable-dev-shm-usage')

this.carloInternal = await carlo.launch({
args,
args: [
// Fix wrong rendered position of elements in <foreignObject>
// https://bugs.chromium.org/p/chromium/issues/detail?id=467484
'--enable-blink-gen-property-trees',

// Puppeteer >= v1.13.0 cannot use BGPT due to crbug.com/937609.
// https://github.com/GoogleChrome/puppeteer/commit/ef2251d7a722bcd6d183f7876673224ac58f2244
//
// Related bug is affected only in capturing, so we override
// `--disable-features` option to prevent disabling BGPT.
'--disable-features=site-per-process,TranslateUI',
],
height: this.options.height,
width: this.options.width,
channel: ['canary', 'stable'],
Expand Down

0 comments on commit 0bf9943

Please sign in to comment.