vue-web-extension
vue-web-extension copied to clipboard
executeScript with a file?
I'm wondering, how can I set script file for executeScipt?
browser.tabs.executeScript(null, {
file: 'script.js'
}, (result) => {
...
});
Is it require different build with separated file or is it possible to do it in a simpler way?
My current workaround looks like this:
import { bodyOfMethod } from '@/js/script'
browser.tabs.executeScript(null, {
code: `(${bodyOfMethod})()`
}, (result) => {
...
});
but it looks hacky to me.