Open lukasfarina opened 5 months ago
<img src="${chrome.runtime.getURL(src)}" />
https://crxjs.dev/vite-plugin/getting-started/vanilla-js/add-content-script#get-the-right-url
<img src="${chrome.runtime.getURL(src)}" />
https://crxjs.dev/vite-plugin/getting-started/vanilla-js/add-content-script#get-the-right-url
I was trying the same thing in january this year in popup.js it works fine, but not in content_script. I've ended up hosting the images on my website and loading by https uri
I believe this one should be closed as getURL is the solution @jacksteamdev
Build tool
Vite
Where do you see the problem?
Describe the bug
When trying to import an image asset in a content script, the path entered is relative to the website and not the extension folder.
Reproduction
import Logo from '../path/logo.png'
Logs
System Info
Severity
annoyance