async function injectScript(settings, allFrames) {
    const MAX_WAIT = 1000;

    return new Promise(async (resolve, reject) => {
        const waitTimeout = setTimeout(reject, MAX_WAIT);
        await chrome.scripting.executeScript({
            target: { tabId: settings.tab.id, allFrames: allFrames },
            files: ["js/inject.dist.js"],
        });
        clearTimeout(waitTimeout);
        resolve(true);
    });
}
Inject script

@param object settings Settings object
@param boolean allFrames Inject in all frames
@return object Cancellable promise