Hi,
Is there a way of adding this to a chrome extension? I want to highlight all same words which involves me adding a span to those found.
I have tried to add it in the manifest.json like this;
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["lib/findAndReplaceDOMText.js", "content.js"]
}
],
as well as trying to append it via background.js (preload) or content.js (page) with something like this;
let script = document.createElement("script");
script.setAttribute("src", "lib/findAndReplaceDOMText.js");
(document.head || document.documentElement).appendChild(script);
script.remove();
However the console says;
findAndReplaceDOMText.js:7 Uncaught SyntaxError: Unexpected token <
Hi,
Is there a way of adding this to a chrome extension? I want to highlight all same words which involves me adding a span to those found.
I have tried to add it in the manifest.json like this;
as well as trying to append it via
background.js(preload) orcontent.js(page) with something like this;However the console says;
findAndReplaceDOMText.js:7 Uncaught SyntaxError: Unexpected token <