Skip to content

Instantly share code, notes, and snippets.

View cuijiudai's full-sized avatar
💭
I may be slow to respond.

独孤逸辰 cuijiudai

💭
I may be slow to respond.
  • Haier
  • Qingdao China
View GitHub Profile
@jangnezda
jangnezda / main.js
Created October 12, 2016 11:44
How to load an external URL in <iframe> using Electron
/*
* By default, Electron (well, underlying Chrome browser) will reject loading external URLs
* to an <iframe>. To circumvent this limitation, we can manipulate response headers from any
* http request and feed them to the Electron window.
*
* The 'onHeadersReceived' listener is documented here:
* http://electron.atom.io/docs/api/session/#webrequestonheadersreceivedfilter-listener
*/
app.on('ready', () => {