Skip to content

Instantly share code, notes, and snippets.

@jaeh
Created October 3, 2022 13:43
Show Gist options
  • Save jaeh/f5eb66a7a0f84d50c220beb170242d64 to your computer and use it in GitHub Desktop.
Save jaeh/f5eb66a7a0f84d50c220beb170242d64 to your computer and use it in GitHub Desktop.
var ua = window.navigator.userAgent
var ios13 = ua.includes('mac') && 'ontouchend' in W.D
var iDevice = ['ipad', 'iphone', 'ipod'].some(device => ua.includes(device))
var ios = iDevice || ios13
var isWebxrViewer = ios && ua.includes('webxrviewer')
if (isWebxrViewer) {
var links = document.getElementsByTagName('a')
for (var id in links) {
if (links[id].target) {
links[id].target = undefined
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment