|
|
@ -295,7 +295,11 @@ function hideElementByID(id) {
|
|
|
|
* @param {string} [toastText] - Text shown by toast.
|
|
|
|
* @param {string} [toastText] - Text shown by toast.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function copyToClipboard(text, toastText = JOIN_URL_PASTE) {
|
|
|
|
function copyToClipboard(text, toastText = JOIN_URL_PASTE) {
|
|
|
|
|
|
|
|
if (typeof navigator.clipboard !== "undefined") {
|
|
|
|
navigator.clipboard.writeText(text);
|
|
|
|
navigator.clipboard.writeText(text);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
toastText = "Can not copy to clipboard in insecure context.";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Find snackbar element
|
|
|
|
// Find snackbar element
|
|
|
|
const snackbar = dom.snackbar();
|
|
|
|
const snackbar = dom.snackbar();
|
|
|
|