Skip to content

Instantly share code, notes, and snippets.

@cdata
Created May 10, 2019 22:27
Show Gist options
  • Select an option

  • Save cdata/7fde40884988ec7f5c9faf5007a2c523 to your computer and use it in GitHub Desktop.

Select an option

Save cdata/7fde40884988ec7f5c9faf5007a2c523 to your computer and use it in GitHub Desktop.
Example showing how to disable <model-viewer> Quick Look integration in iOS Chrome
<model-viewer src="something.glb" ios-src="something.usdz" ar>
</model-viewer>
<!-- ... somewhere after the <model-viewer> tag ... -->
<script>
function disableQuickLookForIosChrome() {
var modelViewer = document.querySelector('model-viewer');
var isIosChrome = /CriOS/.test(navigator.userAgent);
if (isIosChrome) {
modelViewer.removeAttribute('ios-src');
}
}
window.addEventListener('DOMContentLoaded', function() {
disableQuickLookForIosChrome();
}, { once: true });
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment