Closed Bug 1750965 Opened 3 years ago Closed 3 years ago

Firefox Extension - Page can't call "addEventListener" of iframe that is created by content script

Categories

(WebExtensions :: General, defect)

Firefox 97
defect

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: eadan.y, Unassigned)

Details

Steps to reproduce:

Use extension content-script to create and add an iframe to the DOM:
var iframeElement = window.document.createElement('iframe');
iframeElement.id = 'iframe-id';
iframeElement.style.cssText = 'display:none; visibility:hidden';
iframeElement.src = 'about:blank';
window.document.documentElement.appendChild(iframeElement);

Use a script on the page to find that iframe (by id).
call iframe.contentWindow.addEventListener - error is thrown.

Actual results:

iframe.contentWindow.addEventListener throws exception.

Note: using 'window.wrappedJSObject' instead of "window" to create the iframe - works.

Expected results:

iframe.contentWindow.addEventListener should work - it works in chrome.

Hello,

I’m from QA and I’m attempting to reproduce the issue in order to confirm it, however I’m having a bit of trouble with building the extension.

As such, would you mind providing the extension you used when encountering the issue and maybe some more detailed steps to reproduce?

I’m also going to change the component of the report to match the issue.

Thank you !

Component: Untriaged → General
Product: Firefox → WebExtensions

I cannot reproduce this issue; I am able to use frame.contentWindow.addEventListener.

If you have reproduction steps that trigger this bug, please share the extension and steps to reproduce.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.