ng_xyz
PD🧩 Plasmo Developers
•Created by ng_xyz on 4/18/2024 in #🔰newbie
Hey all. Anyone know how to inject styles as a .css file to some webpage?
im rewriting some extension since we are going to mv3, also i decieded to use Plasmo framework for this, all cool i like it so far but im not sure where to put my files so they get bundled in final code. I have this .css file that im trying to inject when website loads.
const insertCSSRule = async (request, sender) => {
return chrome.scripting.insertCSS({
target: { tabId: sender.tab.id },
files: [
../rules/website.css
],
}). catch(console.error);
}
and but this gets me
Error: Could not load file: '../rules/website.css'.
i also tried ./rules/website.css, rules/website.css ./website.css, website.css while file is in rules folder or in assets, i even tried moving entire rules in assets but nothing seems to work.7 replies