Created
May 6, 2018 13:42
-
-
Save liesislukas/64307154ea321742c1ef698b9bfd6f6b to your computer and use it in GitHub Desktop.
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
export default function openInTab({url}) { | |
let instance = window.open('about:blank'); | |
if (url.indexOf('http') !== 0) { | |
url = `http://${url}`; | |
} | |
let meta = `<meta http-equiv="refresh" content="0;url=${url}">`; | |
instance.document.write(meta); | |
instance.document.close(); | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment