Created
November 5, 2017 20:19
-
-
Save Nomy/c67c2baf6b732544dd003732676db838 to your computer and use it in GitHub Desktop.
WebFix_V1.01 - redirect.html by Byte
This file contains 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
<html> | |
<head> | |
<title>WebFix</title> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
function escapeHtml(text) { | |
return text | |
.replace(/</g, "<") | |
.replace(/>/g, ">") | |
.replace(/"/g, """) | |
.replace(/'/g, "'"); | |
} | |
function fetchUrlParams(url) { | |
var urlParams = {}; | |
url.replace( | |
new RegExp("([^?=&]+)(=([^&]*))?", "g"), | |
function($0, $1, $2, $3) { | |
urlParams[$1] = $3; | |
} | |
); | |
return urlParams; | |
}; | |
var urlToParse = window.location.href; | |
var params = fetchUrlParams(urlToParse); | |
var url = 'about:blank'; | |
var width = screen.width; | |
var height = screen.height; | |
if (typeof params.url != 'undefined') | |
url = escapeHtml(decodeURIComponent(params.url)); | |
if (typeof params.width != 'undefined' && params.width != 0) | |
width = escapeHtml(params.width); | |
if (typeof params.height != 'undefined' && params.height != 0) | |
height = escapeHtml(params.height); | |
window.open(url, "_blank", "width=" + width + ", height=" + height); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment