Ah yes, I forgot about this. Yes you can use a Javascript function. I quickly searched for some solution and you can do this:
1. Add the following code to your HTML file:
Code:
<script>
function CopyToClipboard(text) {
if (navigator.clipboard) {
navigator.clipboard.writeText(text);
} else {
var elt = document.createElement("textarea");
elt.value = text;
elt.style.position = "fixed";
elt.style.top = "0";
elt.style.left = "0";
document.body.appendChild(elt);
elt.focus();
elt.select();
document.execCommand('copy');
document.body.removeChild(elt);
}
}
</script>
2. In your MFA add a HTML5 object, and call the CopyTextToClipboard function like this:
HTML5 : Reset Parameters
HTML5 : Add String Parameter "random text to copy"
HTML5 : Call Function "CopyToClipboard"
Note: as I said above I *think* you can do this only from a user input event, e.g. User click condition and/or Button click condition.
Note 2: we'll implement this function in a future update.
EDIT: I tested it on latest versions of Firefox, Chrome, Edge and Opera. Not tested on Safari. In theory it should work on older browsers too.