A polyfill for `window.showModalDialog`