Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<title>Test showPicker() in an iframe</title>
<script type=module>
const urlParams = new URLSearchParams(location.search);
const documentDomain = urlParams.get('documentDomain');
if (documentDomain) {
document.domain = documentDomain;
}
let securityErrors = [];
const select = document.createElement("select");
try {
select.showPicker();
} catch (error) {
if (error instanceof DOMException && error.name == 'SecurityError') {
securityErrors.push("select");
}
}
parent.postMessage(securityErrors.join(','), "*");
</script>