I’m new to developing Chrome Extensions, but have programming experience. I would like to know if it is possible to embed an external image in every website that the user visits?
e.g. a small banner image at the top of every website, I have looked into ‘content scripts’ but I’m not sure if the image has to be on the website directory already or if you can load an external image.
Short answer:
YES!
Long answer:
Yes, you can use an external image. But you I’d not recommend to you, for example, inject an
<img>tag in the page. I’ve experienced some cross-domain errors eventually with this method.That’s the way I do:
First of all you should add the image host domain into the manifest permissions.
manifest.json:
Then load the image from the extension domain and inject the image data in some
<img>tag.Hope it helps…