Created
June 21, 2020 12:12
-
-
Save marcus-herrmann/540a9419afc2861dee8484587565e5ec 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
if (document.referrer) { | |
const referrerHostname = (new URL(document.referrer)).hostname; | |
let main; | |
if (location.hostname === referrerHostname) { | |
main = document.querySelector('main'); | |
if (!!main) { | |
main.focus(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment