Currently, we have used content scripts for "Console Integration"
|
"scripts/contentScript.js" |
https://github.com/secretlint/webextension/blob/main/app/scripts/contentScript.ts
This approach always inject content scripts to any website.
Instead of it, we want to use chrome.scripting.executeScript, however it does not exists on Firefox.
tabs.executeScript() does not support arguments.
(Also we need to inject again when move pages.)
📝 Details of context.
tabs.executeScript({ code }) use dynamic eval, This is another reason why i avoid.
We need to treat it with caution and it will make complex.
tabs.executeScript() support file but it is not dynamic(no arguments).
tabs.executeScript() support code but it just use eval.
chrome.scripting.executeScript support freezed function and arguments, but Firefox does not support yet.
chrome.scripting.executeScript(
{
target: {tabId: tabId},
func: changeBackgroundColor,
args: [color],
},
() => { ... });
Related #4
Currently, we have used content scripts for "Console Integration"
webextension/app/manifest.json
Line 21 in 7d1ded1
https://github.com/secretlint/webextension/blob/main/app/scripts/contentScript.ts
This approach always inject content scripts to any website.
Instead of it, we want to use
chrome.scripting.executeScript, however it does not exists on Firefox.tabs.executeScript()does not support arguments.(Also we need to inject again when move pages.)
📝 Details of context.
tabs.executeScript({ code })use dynamiceval, This is another reason why i avoid.We need to treat it with caution and it will make complex.
tabs.executeScript()supportfilebut it is not dynamic(no arguments).tabs.executeScript()supportcodebut it just useeval.chrome.scripting.executeScriptsupport freezed function and arguments, but Firefox does not support yet.Related #4