Created
February 16, 2019 16:58
-
-
Save xPomaHx/a84189104a02efeac5001971e12b257a to your computer and use it in GitHub Desktop.
siteperfomanse bult test
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
let siteuri = document.location.href; | |
let sitechekers = [{ | |
method: 'post', | |
url: 'gtmetrix.com/analyze.html', | |
data: { | |
'url': siteuri | |
}, | |
}, | |
{ | |
method: 'get', | |
url: 'validator.w3.org/check', | |
data: { | |
'uri': siteuri | |
}, | |
}, | |
{ | |
method: 'get', | |
url: 'jigsaw.w3.org/css-validator/validator', | |
data: { | |
'uri': siteuri, | |
'profile': 'css3svg', | |
'usermedium': 'all', | |
'warning': '2', | |
}, | |
}, | |
{ | |
method: 'get', | |
url: 'validator.w3.org/checklink', | |
data: { | |
'uri': siteuri, | |
'hide_type': 'all', | |
'check': 'Check', | |
}, | |
}, | |
{ | |
method: 'post', | |
url: 'tools.pingdom.com/v1/tests/creat', | |
data: { | |
url: siteuri, | |
}, | |
}, | |
{ | |
method: 'get', | |
url: 'developers.google.com/speed/pagespeed/insights', | |
data: { | |
url: siteuri, | |
}, | |
}, | |
]; | |
document.body.innerHTML = ''; | |
for (let sitecheker of sitechekers) { | |
let form = document.createElement('form'); | |
form.setAttribute('action', '//' + sitecheker.url); | |
form.setAttribute('target', sitecheker.url); | |
form.setAttribute('method', sitecheker.method); | |
for (let namepayload in sitecheker.data) { | |
let input = document.createElement('input'); | |
input.setAttribute('type', 'hidden'); | |
input.setAttribute('name', namepayload); | |
input.setAttribute('value', sitecheker.data[namepayload]); | |
form.insertBefore(input, null); | |
} | |
let submit = document.createElement('input'); | |
submit.setAttribute('type', 'submit'); | |
submit.setAttribute('value', sitecheker.url); | |
form.insertBefore(submit, null); | |
let iframe = document.createElement("iframe"); | |
iframe.setAttribute("name", sitecheker.url); | |
form.insertBefore(iframe, null); | |
document.body.insertBefore(form, null); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment