mirror of
https://github.com/electron/electron.git
synced 2026-01-08 23:18:06 -05:00
use new Buffer.from
This commit is contained in:
@@ -137,7 +137,7 @@ Example:
|
||||
const {protocol} = require('electron')
|
||||
|
||||
protocol.registerBufferProtocol('atom', (request, callback) => {
|
||||
callback({mimeType: 'text/html', data: new Buffer('<h5>Response</h5>')})
|
||||
callback({mimeType: 'text/html', data: Buffer.from('<h5>Response</h5>')})
|
||||
}, (error) => {
|
||||
if (error) console.error('Failed to register protocol')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user