Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ipcRemote.sendSync() in lib/isolated_renderer/init.js (backport: 3-0-x) #13997

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/isolated_renderer/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
'use strict'

const {send, sendSync} = binding
const {parse} = JSON

const ipcRenderer = {
send (...args) {
return send('ipc-message', args)
},

sendSync (...args) {
return parse(sendSync('ipc-message-sync', args))
return sendSync('ipc-message-sync', args)[0]
},

// No-ops since events aren't received
Expand Down
1 change: 1 addition & 0 deletions spec/api-browser-window-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3072,6 +3072,7 @@ describe('BrowserWindow module', () => {
typeofFunctionApply: 'function'
},
pageContext: {
openedLocation: '',
preloadProperty: 'undefined',
pageProperty: 'string',
typeofRequire: 'undefined',
Expand Down
2 changes: 2 additions & 0 deletions spec/fixtures/api/isolated.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
Function.prototype.apply = true

const opened = window.open()
const openedLocation = opened.location
opened.close()

window.postMessage({
openedLocation,
preloadProperty: typeof window.foo,
pageProperty: typeof window.hello,
typeofRequire: typeof require,
Expand Down
1 change: 1 addition & 0 deletions spec/webview-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ describe('<webview> tag', function () {
typeofFunctionApply: 'function'
},
pageContext: {
openedLocation: '',
preloadProperty: 'undefined',
pageProperty: 'string',
typeofRequire: 'undefined',
Expand Down