diff --git a/src/3rd/js/three/navigator.js b/src/3rd/js/three/navigator.js index 2e60ecb..a795997 100644 --- a/src/3rd/js/three/navigator.js +++ b/src/3rd/js/three/navigator.js @@ -1,5 +1,8 @@ xrf.navigator = { + opts: { + openInNewTab: true + }, URI: xrf.URI.parse(document.location.href) // scheme: document.location.protocol.replace(/:$/,''), // directory: document.location.pathname, @@ -134,7 +137,12 @@ xrf.navigator.setupNavigateFallbacks = () => { if( url.match(/^http/) && url != xrf.navigator.URI.URN && !xrf.loaders[fileExt] ){ let inIframe try { inIframe = window.self !== window.top; } catch (e) { inIframe = true; } - return inIframe ? window.parent.postMessage({ url }, '*') : window.open( url, '_blank') + if( inIframe ){ + window.parent.postMessage({ url }, '*') + }else{ + if( xrf.navigator.opts.openInNewTab ) window.open( url, '_blank') + else{ setTimeout( () => document.location.href = url, 1000) } + } // in case you're running in an iframe, then use this in the parent page: // // window.addEventListener("message", (e) => {