5

Is there a way using JavaScript code to know what JavaScript Engine, is the one on which that code is run on?

I don't want to get the browser type just the JavaScript engine.

Eduard Florinescu
  • 16,747
  • 28
  • 113
  • 179

1 Answers1

2

See How can I detect which javascript engine (v8 or JSC) is used at runtime in Android? for some JavaScript code that uses feature detection to determine the platform.

Also:

I think the better question is: Why do you care? You're basically falling into the "browser detection" trap that a lot of people fell into in the late 90's / early 00's. Since then, though, we've learned that it's feature detection that's the more useful approach, not least because the features supported in a given browser were (mostly) a moving target. There's code now, running on IE9 with its dramatically-improved DOM and JavaScript support, that's not using those features because it's doing browser detection and falling back on IE6 techniques.

from: https://stackoverflow.com/a/6768595/1183010

Community
  • 1
  • 1
R. Oosterholt
  • 7,720
  • 2
  • 53
  • 77
  • 4
    I have many motives to want to do that, but also from curiosity. One of the reasons are web-runtimes that many mobile OSs suporting HTML5 have. I can automate deploying an app that queries the JS-engine and have a know what's new under the hood. – Eduard Florinescu Oct 29 '13 at 13:50
  • 3
    In that case, there is some code http://stackoverflow.com/a/6768595/1183010 to detect the engine (if you insist) – R. Oosterholt Oct 29 '13 at 13:55