mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
chore: bump chromium to 85.0.4183.19 (10-x-y) (#24299)
* chore: bump chromium in DEPS to 85.0.4182.1 * chore: bump chromium in DEPS to 85.0.4183.2 * chore: bump chromium in DEPS to 85.0.4183.4 * chore: bump chromium in DEPS to 85.0.4183.5 * update patches * chore: bump chromium in DEPS to 85.0.4183.6 * chore: bump chromium in DEPS to 85.0.4183.7 * update patches * chore: bump chromium in DEPS to 85.0.4183.8 * remove chromeos-only TtsControllerDelegate Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2255314 (cherry picked from commitf975f84a3c) * rename GetHighContrastColorScheme -> GetPlatformHighContrastColorScheme Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2250224 (cherry picked from commit014b487258) * add max_xcode_version build var Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2264867 (cherry picked from commit2c3b94f497) * add empty floc blocklist to BrowserProcessImpl Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2240873 (cherry picked from commit3cdaae146d) * Move zygote from //services/service_manager back to //content https://chromium-review.googlesource.com/c/chromium/src/+/2252466 (cherry picked from commite0d6dbcf1e) * Reland "[base] Stop including check.h, notreached.h, etc. in logging.h" https://chromium-review.googlesource.com/c/chromium/src/+/2264297 (cherry picked from commit1407040133) * Update mas private api patch * Reland "Reland "New toolchain for Windows 10 19041 SDK"" https://chromium-review.googlesource.com/c/chromium/src/+/2255527 (cherry picked from commit8101d956f5) * [XProto] Remove usage of Shape extension https://chromium-review.googlesource.com/c/chromium/src/+/2262113 (cherry picked from commit72b6f11958) * chore: bump chromium in DEPS to 85.0.4183.9 * chore: bump chromium in DEPS to 85.0.4183.10 * chore: bump chromium in DEPS to 85.0.4183.11 * chore: bump chromium in DEPS to 85.0.4183.12 * chore: bump chromium in DEPS to 85.0.4183.13 * update patches * fixup! add empty floc blocklist to BrowserProcessImpl (cherry picked from commit07b0b65c1d) * fixup! Reland "[base] Stop including check.h, notreached.h, etc. in logging.h" (cherry picked from commitf91c1ab162) * Check for GDI exhaustion if window creation fails https://chromium-review.googlesource.com/c/chromium/src/+/2244124 (cherry picked from commit3d45d7b78c) * chore: bump chromium in DEPS to 85.0.4183.14 * Fixup lint issue * update patches * fix: include missing header file * chore: bump chromium in DEPS to 85.0.4183.19 * update patches * refactor: match upstream print preview handling (#24452) (cherry picked from commit004e29ad33) * use PrintHostMsg_DidPreviewPage_Params https://chromium-review.googlesource.com/c/chromium/src/+/2257124 Co-authored-by: Andy Locascio <andy@slack-corp.com> Co-authored-by: Electron Bot <anonymous@electronjs.org> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: John Kleinschmidt <jkleinsc@github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
@@ -1371,6 +1371,8 @@ An example of `webContents.printToPDF`:
|
||||
```javascript
|
||||
const { BrowserWindow } = require('electron')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const os = require('os')
|
||||
|
||||
let win = new BrowserWindow({ width: 800, height: 600 })
|
||||
win.loadURL('http://github.com')
|
||||
@@ -1378,12 +1380,13 @@ win.loadURL('http://github.com')
|
||||
win.webContents.on('did-finish-load', () => {
|
||||
// Use default printing options
|
||||
win.webContents.printToPDF({}).then(data => {
|
||||
fs.writeFile('/tmp/print.pdf', data, (error) => {
|
||||
const pdfPath = path.join(os.homedir(), 'Desktop', 'temp.pdf')
|
||||
fs.writeFile(pdfPath, data, (error) => {
|
||||
if (error) throw error
|
||||
console.log('Write PDF successfully.')
|
||||
console.log(`Wrote PDF successfully to ${pdfPath}`)
|
||||
})
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
console.log(`Failed to write PDF to ${pdfPath}: `, error)
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user