0

I'm building a chrome extension and would like to place a onedrive document in an iframe. It seems that no matter how I alter the following code, I can't seem to get the cross origin error to go away.

Url:

https://1drv.ms/x/s!ArcbZ_8xcTVdjBBU8wRdvhJgvPcw

Manifest permissions:

"webRequest",
"webRequestBlocking",

Event Listener:

chrome.webRequest.onHeadersReceived.addListener(function (details) {
        for (var i = 0; i < details.responseHeaders.length; i++) {
            if (details.responseHeaders[i].name.toLowerCase() === 'x-frame-options') {
                details.responseHeaders.splice(i, 1);
                break;
            }
        }
        return { requestHeaders: details.requestHeaders };
    },
    { urls: ['https://onedrive.live.com/*'] },
    ['blocking', 'responseHeaders']
);

I've tried removing the x-frame-options with and without "blocking". I'm sure this is just a minor syntax issue.

N-ate
  • 6,051
  • 2
  • 40
  • 48
  • 2
    You splice responseHeaders but return requestHeaders. See [Getting around X-Frame-Options DENY in a Chrome extension?](//stackoverflow.com/a/15534822) – wOxxOm Oct 30 '17 at 07:10
  • Different question, same answer. – N-ate Oct 30 '17 at 16:48

0 Answers0