Short version: I am trying to load R and use it in an iframe inside an anvil app, but I get errors related to headers and do not know if we can change these or work around the problem.
Details
I have the following in the header of the html:
import('https://webr.r-wasm.org/latest/webr.mjs').then(
async ({ WebR }) => {
const webR = new WebR();
await webR.init();
}
);
This gives an error:
R.bin.js:2061 Refused to get unsafe header “Content-Encoding”
Which may be related to a security requirement when loading webR:
To ensure a web page is cross-origin isolated, serve the page with COOP and COEP HTTP headers set to:
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
Question: Before I try to fix it, does anyone know whether it is possible to make something like this work? Seems to me that we cannot change the headers in this way in Anvil, or?