Created
October 11, 2024 07:47
-
-
Save aont/d67016882aa379e88fabebd24e68dd2f 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
(function() { | |
let browserName; | |
if(navigator.userAgentData) { | |
var brandSpecific = navigator.userAgentData.brands.find(function(brand) {return brand.brand == "Google Chrome" || brand.brand == "Microsoft Edge";}) | |
if(brandSpecific) { | |
browserName = brandSpecific.brand + " " + brandSpecific.version; | |
} else { | |
browserName = navigator.userAgentData.brands.map(function (brand, index, array) { return brand.brand + " " + brand.version; }).join(", ") | |
} | |
} else { | |
browserName = navigator.userAgent; | |
} | |
var a = document.createElement("a"); | |
a.onclick = function() { | |
var s = window.screen; | |
var w = window.open("about:blank", "_blank", "popup,location=0,menubar=no,toolbar=no,location=no,status=no,scrollbars=no,width=300,height=100,left="+s.availWidth.toString()+",top="+s.availHeight.toString());w.document.write("<a href=about:blank target=_blank>"+browserName+"</a>"); | |
}; | |
a.click(); | |
a.remove(); | |
})(); |
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
!function(){let browserName;if(navigator.userAgentData){var brandSpecific=navigator.userAgentData.brands.find((function(brand){return"Google Chrome"==brand.brand||"Microsoft Edge"==brand.brand}));browserName=brandSpecific?brandSpecific.brand+" "+brandSpecific.version:navigator.userAgentData.brands.map((function(brand,index,array){return brand.brand+" "+brand.version})).join(", ")}else browserName=navigator.userAgent;var a=document.createElement("a");a.onclick=function(){var s=window.screen,w;window.open("about:blank","_blank","popup,location=0,menubar=no,toolbar=no,location=no,status=no,scrollbars=no,width=300,height=100,left="+s.availWidth.toString()+",top="+s.availHeight.toString()).document.write("<a href=about:blank target=_blank>"+browserName+"</a>")},a.click(),a.remove()}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment