Just recently, I created a Chrome Extension with the purpose of making all webpages utilize a specific font. Everything was functioning perfectly fine until yesterday (or possibly even earlier).
The crucial codes for this extension are:
manifest.json
file details:{ ... "content_scripts": [{ "matches": ["http://*/*", "https://*/*"], "js": ["font.js"], "run_at":"document_start" }], "web_accessible_resources": ["font.css"] }
font.js
file contents:var link = document.createElement("link"); link.href = chrome.extension.getURL("font.css"); link.type = "text/css"; link.rel = "stylesheet"; document.documentElement.insertBefore(link);
font.css
file details:* { font-family: "Microsoft Yahei Mono", "Microsoft Yahei", sans-serif !important; }
I am perplexed by the sudden malfunction and would greatly appreciate any insights into understanding what is causing this issue. Alternatively, if anyone has suggestions on alternative ways to execute the js
file when initiating webpage documents, please share!