crxjs / chrome-extension-tools

Bundling Chrome Extensions can be pretty complex. It doesn't have to be.
https://crxjs.dev/vite-plugin
2.9k stars 191 forks source link

Content.js gets mounted on all iframes #526

Closed tarasowski closed 2 years ago

tarasowski commented 2 years ago

Build tool

Vite

Where do you see the problem?

Describe the bug

If a website has multiple iframes, the content.js gets mounted on all of the iFrames. First it gets mounted to the body and then to all of the iframes.

Reproduction

Basic installation Svelte + Vite + CRXJS. I followed the install instruction from the website.

Logs

No response

System Info

System:
    OS: Linux 5.15 Ubuntu 20.04.5 LTS (Focal Fossa)
    CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
    Memory: 21.91 GB / 31.05 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 16.15.0 - /usr/local/bin/node
    npm: 8.5.5 - /usr/local/bin/npm
  Browsers:
    Chrome: 105.0.5195.125
    Firefox: 105.0

Severity

annoyance

tarasowski commented 2 years ago

Screenshot from 2022-10-15 21-18-08 As you can see here, the content.js is visible into two places, these are iframes on the website. This is the website: https://www.duden.de/rechtschreibpruefung-online

tarasowski commented 2 years ago

Looks like after restarting my laptop and resetting the chrome extension, everything works fine again.