Skip to content

Instantly share code, notes, and snippets.

@jangnezda
jangnezda / main.js
Last active December 8, 2021 17:02
How to capture requests from <iframe> in Electron window
/*
* By default, the Electron (or underlying Chrome instance, to be more precise) will not allow
* javascript communication between parent window and an <iframe>. Which makes it hard to cover
* scenarios when you want to do something after an action has been performed inside the <iframe>.
* This example shows how to react on web reqest from within <iframe>.
*
* The 'onBeforeRequest' listener is documented here:
* http://electron.atom.io/docs/api/session/#webrequestonbeforerequestfilter-listener
*/