Created
May 10, 2019 22:27
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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