The answer is from StackOverflow. Open this webpage at http://jsbin.com/opuvas. this webpage is also written by the respondent.
The QR code is the URL. The webpage contains statistics on the access volume. The author wants to know how many people are useful. We recommend that you respect originality and do not copy this webpage.
Available for both PC and mobile browsers.
The principle is this section of js:
Copy codeThe Code is as follows:
Window. onload = function (){
Var v8string = 'function % 20 javaEnabled % 28% 29% 20% 7B % 20% 5 Bnative % 20 code % 5D % 20% 7D ';
If (window. devicePixelRatio) // If WebKit browser
{
If (escape (navigator. javaEnabled. toString () === v8string)
{
Display ('v8 detected ');
}
Else
{
Display ('jsc detected ');
}
}
Else {
Display ("Not a WebKit browser ");
}
Function display (msg ){
Var p = document. createElement ('P ');
P. innerHTML = msg;
Document. body. appendChild (p );
}
};
First, check the devicePixelRatio attribute that is unique to WebKit, and then check the implementation of the javaEnabled function that is unique to v8.