<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>test</title>
<script>
window.onload=()=>{
const modelUrl = new URL("test.usdz", self.location.toString());
/*
if (this.arScale === 'fixed') {
if (modelUrl.hash) {
modelUrl.hash += '&';
}
modelUrl.hash += 'allowsContentScaling=0';
}*/
const anchor = document.getElementById("hoge");
anchor.setAttribute('rel', 'ar');
const img = document.createElement('img');
anchor.appendChild(img);
anchor.setAttribute('href', modelUrl.toString());
// attach anchor to shadow DOM to ensure iOS16 ARQL banner click message event propagation
anchor.style.display = 'none';
if (!anchor.isConnected)
this.shadowRoot.appendChild(anchor);
console.log('Attempting to present in AR with Quick Look...');
anchor.click();
anchor.removeChild(img);
}
</script>
</head>
<body>
<a id="hoge"></a>
</body>
</html>