You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am loading potentially unsafe pages into a BrowserWindow, however, I still need those windows to be able to send messages to the server. If I use node-integration = disable, to make loading the page safe, that disables the ability to use ipc, correct?
I think there might still be an issue here. I'm working on an app that needs to be able to do the following:
Load an arbitrary user-supplied web page into a secure container
Inject some Javascript code into the page
Have the page send back a message with results
At first glance, this would seem be possible in Atom today using a iframe with node-integration=disable and window.postMessage. However, many pages use the X-Frame-Options header to prevent being loaded in an iframe. So that means I have to load these pages in their own window. But with node integration disabled, I don't think there's any way for me to receive messages from that window, or listen for postMessage events.
@phvcky I think that would work, although I'm not sure if old-fashioned Javascript-based frame-busting would still be an issue. If there's going to be an iframe that acts like a self-contained window, I think the ideal solution would be the ability to embed a BrowserWindow or WebContents in a page, similar to the webview tag in Chrome apps. Of course, that would still leave the problem of not being able to listen for postMessage events on the embedded WebContents.
I second the suggestion from @bgSosh. We only need the ability to pass messages and it would be wonderful to use the provided ipc module without concerns for full node access security issues.
I thinking of writing a hack by listening on page-title-updated and I don't think I'll be able to look at myself in the mirror if I go through with it...
Being able to use IPC means you can use remote eval, because that's how remote eval works. Having IPC enabled in a webpage is no different from a security boundary perspective than having node integration enabled
I need to use jQuery from the pages that user loads in renderer process, but still use ipc.
In order for the websites to load properly I need to disable node integration so they can use jquery.
Does anyone have any idea how that might be achieved ? I'm doubtful that I'm the only one that needs jQuery on pages to load in Renderer process but still be able to use ipc., so any help would be appreciated, since I've read through issues #2048 and #1753, even tried #3921 with no succes.
Activity
zcbenz commentedon Jul 21, 2014
The ipc relies heavily on the node integration so it is unlikely that we would ever support using ipc without node integration.
For your purpose, you may put the unsafe pages in iframe and do the ipc in the main frame.
cpsubrian commentedon Jul 21, 2014
Just a note, I would then need the iframe to communicate with the main frame, which can certainly be done with something like
window.postMessage.Thanks for clarifying the situation :)
abram commentedon Jul 24, 2014
I think there might still be an issue here. I'm working on an app that needs to be able to do the following:
At first glance, this would seem be possible in Atom today using a iframe with node-integration=disable and window.postMessage. However, many pages use the X-Frame-Options header to prevent being loaded in an iframe. So that means I have to load these pages in their own window. But with node integration disabled, I don't think there's any way for me to receive messages from that window, or listen for postMessage events.
Thoughts? Am I missing something?
buschtoens commentedon Jul 24, 2014
@abram So basically what you're asking is: How can I make Atom ignore the
X-Frame-Optionsheader? 😄abram commentedon Jul 24, 2014
@phvcky I think that would work, although I'm not sure if old-fashioned Javascript-based frame-busting would still be an issue. If there's going to be an iframe that acts like a self-contained window, I think the ideal solution would be the ability to embed a BrowserWindow or WebContents in a page, similar to the webview tag in Chrome apps. Of course, that would still leave the problem of not being able to listen for postMessage events on the embedded WebContents.
srlowe commentedon Nov 5, 2015
IMO a
node-integration = ipc-onlyoption (or a seperateipc-only = <bool>field) would be a good solution.whiskyagogo commentedon Nov 6, 2015
I second the suggestion from @bgSosh. We only need the ability to pass messages and it would be wonderful to use the provided
ipcmodule without concerns for full node access security issues.arendjr commentedon Nov 6, 2015
+1 for being able to use IPC from web pages.
jdurand commentedon Nov 25, 2015
Is there a simple way to receive CustomEvents from outside the BrowserWindow? Something like :
I thinking of writing a hack by listening on page-title-updated and I don't think I'll be able to look at myself in the mirror if I go through with it...
anaisbetts commentedon Nov 25, 2015
Being able to use IPC means you can use remote eval, because that's how remote eval works. Having IPC enabled in a webpage is no different from a security boundary perspective than having node integration enabled
ava-sig commentedon Apr 26, 2016
I need to use jQuery from the pages that user loads in renderer process, but still use ipc.
In order for the websites to load properly I need to disable node integration so they can use jquery.
Does anyone have any idea how that might be achieved ? I'm doubtful that I'm the only one that needs jQuery on pages to load in Renderer process but still be able to use ipc., so any help would be appreciated, since I've read through issues #2048 and #1753, even tried #3921 with no succes.
ava-sig commentedon Apr 26, 2016
nevermind, I managed to implement electron-safe-ipc which works perfectly with nodeIntegration off, exactly what I needed.