Created
April 27, 2018 11:40
-
-
Save muhammadfaizan/d50cd7931210785fcca3813223bd97a0 to your computer and use it in GitHub Desktop.
This gist is to redirect mobile apps to mobile theme.
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
function redirect(location) { | |
var iframe = document.createElement('iframe'); | |
iframe.setAttribute('src', location); | |
iframe.setAttribute('width', '1px'); | |
iframe.setAttribute('height', '1px'); | |
iframe.setAttribute('position', 'absolute'); | |
iframe.setAttribute('top', '0'); | |
iframe.setAttribute('left', '0'); | |
document.documentElement.appendChild(iframe); | |
iframe.parentNode.removeChild(iframe); | |
iframe = null; | |
}; | |
redirect("custom-app://host"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment