Skip to content

Injecting into iframes doesn't work #41

@theFireProject

Description

@theFireProject

Problem 1: Injecting into iframes doesn't work

I'm trying to inject the following code into the top frame and all iframes (on any website).

But the code is not injected into iframes. It's only injected into the top frame.



This is an example website https://iframetester.com/?url=https://example.com with an iframe embedding https://example.com.

On the console you can see that the code is only injected once into the top frame https://iframetester.com/.... It's not injected into the https://example.com frame.

The test variable is known in the JavaScript context of the top frame. But it's not defined in the https://example.com iframe.



Problem 2: Code gets injected at the wrong place

I tried injecting the same code into https://example.com only.



The result is the same like above. The code does not get injected into the https://example.com iframe but instead gets injected into the top frame https://iframetester.com/... on the test website https://iframetester.com/?url=https://example.com.

Possible explanation

When the Top frame only option is disabled, it seems like Code Injector checks for the existence of iframes with a matching URL. If it finds an iframe with a matching URL, it doesn't inject code into the iframe but instead injects code into the top frame of the website.

This bug makes it impossible to inject code into iframes. The code gets injected in the wrong place. It never gets injected into an iframe.

Code Injector shouldn't inject code into the top frame of the website if the URL of the website doesn't match. It should only inject code into the correct iframe (if the URL of the iframe matches and the Top frames only option is disabled).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions