Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Active scripting

958 views

Published on

@ jser.info 5 years event, Jan 2016

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Active scripting

  1. 1. [R.I.P. IE8] Active Scripting JSer.info event @ Jan 2016
  2. 2. Congratulation jser.info 5 years!
  3. 3. IE 4-8 Architecture • HTML Parse and Render … MsHtml • Browser UX … BrowseUI / ShDocVw -> IEFrame (IE7+) • Networking Stack … WinInet and UrlMon • Scripting … Active Scripting Host
  4. 4. APIs by IE • Web Browser controls using COM APIs • Browser Helper Object (BHO) APIs for browser extension (ex. Toolbar etc) • Pluggable Protocol Moniker • ActiveScripting
  5. 5. Active Scripting • COM interfaces to bind scripting engine • For Engine API • For Host API • Used by • IE (3?-8) • Windows Scripting Host • Active server page (IIS) • Office • 3rd party Apps
  6. 6. Backends • By Microsoft • JScript • VBScript • By 3rd party • Ruby • Python • Perl • PHP • etc
  7. 7. Security? <script language=“python”> import __builtin__ myfile = __builtin__.open(“c:¥¥autoexec.bat”) document.write(str(myfile.readlines())) myfile.close() </script> http://www.python.jp/pipermail/python-ml-jp/2002- January/000977.html
  8. 8. COM Interfaces • IE uses IDispatchEx interface to access methods and properties • As IE, Script was a kind of COM
  9. 9. this access from Host Apps (IE) // Invoke method with "this" pointer DISPID putid = DISPID_THIS; VARIANT var; DISPPARAM disparams; IDispatchEx* pdexObj; var.vt = VT_DISPATCH; var.pdispVal = pdispObj; dispparams.rgvarg = &var; dispparams.rgdispidNamedArgs = &putid; dispparams.cArgs = 1; dispparams.cNamedArgs = 1; pdexObj->InvokeEx(dispid, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
  10. 10. Implement Scripting Engine • Engine must implement IAcriptScript* interfaces such as IActiveScriptHost etc • When using on IE, mark as safe like ActiveX control
  11. 11. Debugger Support • Debugging APIs (COM APIs) to integrate IDE • Profiler API is IE9+ • PDM (Process Debug Manager)
  12. 12. Conclusion • Active Scripting is the binding interface used by IE8 (not IE9+) • APIs is for host, engine and debugging • Bye Bye IE8!
  13. 13. References • Windows Script interfaces • https://msdn.microsoft.com/en-us/library/fdee6589%28v=vs.94%29.aspx • Active Scripting APIs: Add Powerful Custom Debugging to Your Script- Hosting App • https://msdn.microsoft.com/en-us/library/bb984890.aspx • Microsoft Press – Inside Windows Debugging

×