Last active
October 26, 2017 15:08
-
-
Save Noitidart/840c61bd1fb7eb56d2e69bf71038bb7a to your computer and use it in GitHub Desktop.
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
{ | |
"ACCEPT": "application/json", | |
"ACCEPT_ENCODING": "gzip", | |
"ACCEPT_LANGUAGE": "en-US", | |
"CONNECTION": "Keep-Alive", | |
"CONTENT_TYPE": "application/json", | |
"HOST": "www.whatismybrowser.com", | |
"USER_AGENT": "okhttp/3.6.0" | |
} |
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
{ | |
"ACCEPT": "application/json", | |
"ACCEPT_ENCODING": "gzip", | |
"ACCEPT_LANGUAGE": "en-US", | |
"CONNECTION": "Keep-Alive", | |
"CONTENT_TYPE": "application/json", | |
"HOST": "www.whatismybrowser.com", | |
"USER_AGENT": "okhttp/3.6.0" | |
} |
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
(async function() { | |
const res = await fetch('https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending') | |
const text = await res.text(); | |
const patt = /<th>([\s\S]*?)<\/th>[\s\S]*?<td>([\s\S]*?)<\/td>/mg; | |
const headers = {}; | |
let match; | |
while (match = patt.exec(text)) { | |
const [, key, value] = match; | |
headers[key] = value; | |
} | |
alert(JSON.stringify(headers)); | |
// const info = []; | |
// for (const p in DeviceInfo) { | |
// try { | |
// info.push(`${p}: "${DeviceInfo[p]()}"`); | |
// } catch (ignore) {} | |
// } | |
// alert(info.join('\n')); | |
})() |
Author
Noitidart
commented
Oct 26, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment