Skip to content

Instantly share code, notes, and snippets.

@yarkovaleksei
Last active October 22, 2020 22:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save yarkovaleksei/847f56669007c8eb6e0e1749191b8f6f to your computer and use it in GitHub Desktop.
Save yarkovaleksei/847f56669007c8eb6e0e1749191b8f6f to your computer and use it in GitHub Desktop.
// Идем на страницу http://www.useragentstring.com/pages/useragentstring.php?name=All, открываем консоль и вставляем туда этот код.
// Потом жмем на ссылку DOWNLOAD USERAGENT LIST! и список скачан ))
function getAllUA(){
let liArray = document.querySelectorAll("li>a[href*='?id=']");
let uaList = [];
[].forEach.call(liArray, function(el){
let ua = el.innerText;
uaList.push(ua);
});
uaList = new Set(uaList);
let a = document.createElement("a");
a.href = "data:text/octet-stream;base64," + window.btoa(JSON.stringify([...uaList], null, "\t"));
a.download = 'ua.json';
a.textContent = 'DOWNLOAD USERAGENT LIST!';
document.body.appendChild(a);
}
getAllUA();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment