async function copyToClipboard(text, clear = true) {
    if (helpers.isChrome()) {
        await setupOffscreenDocument("offscreen/offscreen.html");
        chrome.runtime.sendMessage({
            type: "copy-data-to-clipboard",
            target: "offscreen-doc",
            data: text,
        });
    } else {
        clipboard.writeToClipboard(text);
    }

    if (clear) {
        lastCopiedText = text;
        chrome.alarms.create("clearClipboard", { delayInMinutes: 1 });
        await keepAlive();
    }
}
Copy text to clipboard and optionally clear it from the clipboard after one minute

@since 3.2.0

@param string text Text to copy
@param boolean clear Whether to clear the clipboard after one minute
@return void