'How to call a function that calls other functions on chrome.scripting.executeScript

I'm trying to call an external function inside the function passed in the 'func' parameter in the chrome.scripting.executeScript call:

await chrome.scripting.executeScript({
    target: {tabId: tabId},
    func: async () => {
        //call a extern function here
    }
})

In this call i get 'ReferenceError: [function name] is not defined'

I would like to know if it is possible, and if so, how is it possible?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source