hackmdio / hackmd-desktop

:notebook: HackMD Desktop Application
305 stars 32 forks source link

Workaround for X-Frame-Options header #14

Open Yukaii opened 6 years ago

Yukaii commented 6 years ago

from https://github.com/electron/electron/pull/573#issuecomment-263186361

  mainWindow.webContents.session.webRequest.onHeadersReceived({}, (d, c) => {
    if(d.responseHeaders['x-frame-options'] || d.responseHeaders['X-Frame-Options']){
        delete d.responseHeaders['x-frame-options'];
        delete d.responseHeaders['X-Frame-Options'];
    }
    c({cancel: false, responseHeaders: d.responseHeaders});
  });