We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// contentScript.ts const freamUrl = chrome.runtime.getURL('src/entries/fream/index.html'); const ifream = document.createElement('iframe'); ifream.src = freamUrl; document.body.appendChild(ifream)
The above code cause CSP error:
The text was updated successfully, but these errors were encountered:
Hi, @chengfengfengwang
You need to put your html file in the public:
html
public
Here is my sample code:
// contentScript.ts function renderIframeContent(page: string, render: (iframe: HTMLIFrameElement) => void) { const iFrameRoot = document.createElement('div') const iFrame = document.createElement('iframe') iFrame.src = browser.runtime.getURL(page) iFrameRoot.appendChild(iFrame) document.body.appendChild(iFrameRoot) render(iFrame) } renderIframeContent('iframe/index.html', (iframe) => { Object.assign(iframe.style, { position: 'fixed', top: '0', right: '0', bottom: '0', left: '0', border: '0', zIndex: '9999999', overflow: 'visible', }) })
I hope this helps!
Sorry, something went wrong.
No branches or pull requests
The above code cause CSP error:
The text was updated successfully, but these errors were encountered: