For everyone who looks for an easy solution, here it is.
function openModal() {
var pu = document.getElementsByClassName('fd-focus-visible-applied');
var modal = pu[0].getElementsByClassName('fd-modal');
modal[0].classList.add('fd-is-open');
}