Python-SpiderMonkey Implemeting Navigator


/ Published in: Python
Save to your folder(s)



Copy this code and paste it in your HTML
  1. >>> from spidermonkey import Runtime
  2. >>>
  3. >>> rt = Runtime()
  4. >>> cx = rt.new_context()
  5. >>>
  6. >>> print cx.eval_script('navigator.appCodeName;')
  7. Mozilla
  8. >>> print cx.eval_script('navigator.appName;')
  9. Netscape
  10. >>> print cx.eval_script('navigator.appVersion;')
  11. 5.0 (Macintosh; en-US)
  12. >>> print cx.eval_script('navigator.cookieEnabled;')
  13. 0
  14. >>> print cx.eval_script('navigator.language;')
  15. en-US
  16. >>> print cx.eval_script('navigator.mimeTypes;')
  17. None
  18. >>> print cx.eval_script('navigator.platform;')
  19. MacIntel
  20. >>> print cx.eval_script('navigator.plugins;')
  21. None
  22. >>> print cx.eval_script('navigator.systemLanguage;')
  23. undefined
  24. >>> print cx.eval_script('navigator.userAgent;')
  25. Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.3) Gecko/2008092414 Firefox/3.0.3
  26. >>> print cx.eval_script('navigator.userLanguage;')
  27. en-ca
  28. >>> print cx.eval_script('navigator.javaEnabled();')
  29. 0

URL: http://blackcodeseo.com/python-spidermonkey-navigator/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.