iframe is not work for background script
Categories
(WebExtensions :: Untriaged, defect)
Tracking
(Not tracked)
People
(Reporter: robert, Unassigned, NeedInfo)
Details
Attachments
(1 file)
104.38 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0
Steps to reproduce:
- create addon with manifest v3
- create and insert
iframe
element in background script. I've tested with a HTML page included in addon bundle
Actual results:
- iframe created, but are empty. No any scripts and elements there
Expected results:
- iframe created with all content of HTML page
- it is possible to message iframe with
postMessage
Comment 1•8 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'WebExtensions::Untriaged' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Reporter | ||
Comment 2•8 months ago
|
||
This problem may be solved if you will append iframe into document first and then set src
:
const iframe = document.createElement('iframe', {});
iframe.setAttribute(
'sandbox',
'allow-same-origin allow-scripts allow-popups allow-forms',
);
document.body.appendChild(iframe);
iframe.src = '/offscreen-documents/translator/translator.html';
Reporter | ||
Comment 3•8 months ago
|
||
But problem still exists if you will set src
and then will append iframe into document:
const iframe = document.createElement('iframe', {});
iframe.src = '/offscreen-documents/translator/translator.html';
iframe.setAttribute(
'sandbox',
'allow-same-origin allow-scripts allow-popups allow-forms',
);
document.body.appendChild(iframe);
Comment 4•8 months ago
|
||
Hello,
Would you be so kind and attach a test extension showcasing the behavior you mentioned?
Thank you !
Comment 5•7 months ago
|
||
We haven't received a test case, so I'm closing the bug because it is not actionable.
We'll re-open if there is a test case that demonstrates a bug.
Description
•