我正在尝试制作Chrome扩展程序,通过寻找关键字的网站进行解析,然后使用按钮替换这些关键字.但是,当我更改文本时,图像路径会损坏.
// This is a content script (isolated environment)
// It will have partial access to the chrome API
// TODO
// Consider adding a "run_at": "document_end" in the manifest...
// don't want to run before full load
// Might also be able to do this via the chrome API
console.log("Scraper Running");
var keywords = ["sword", "gold", "yellow", "blue", "green", "china", "civil", "state"];
// This will match the keywords with the page textx
// Will also create the necessary buttons …Run Code Online (Sandbox Code Playgroud)