1 / 24

From Firefox to IE

Building Add- Ons that Work Cross-Browser Joshua Allen <joshuaa@microsoft.com>. From Firefox to IE. Why Did You Start With Firefox?. Building for IE is Difficult More Controlled Test Bed Mike Arrington Uses Macintosh Your Developers Used Firebug. Why Port to IE?. Bigger Market Share

halil
Télécharger la présentation

From Firefox to IE

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Building Add-Ons that Work Cross-Browser Joshua Allen <joshuaa@microsoft.com> From Firefox to IE

  2. Why Did You Start With Firefox? • Building for IE is Difficult • More Controlled Test Bed • Mike Arrington Uses Macintosh • Your Developers Used Firebug

  3. Why Port to IE? • Bigger Market Share • More Mainstream Users • Higher Bar to Entry for Your Competitors

  4. The Web is About Interop • Users: Things Work The Same on All Browsers • Developers: My Skills Work on All Browsers • Consider Starting With Both Browsers

  5. Creating Your Add-On • Design • Build • Test • Deploy

  6. Design • Use Web Standards • Consider Slices and Accelerators

  7. An Idealistic Example: Oomph • Detect Microformats from Browser • Cross-Browser Tag for Page Owners • IE Toolbar – NOT for Firefox, Safari, etc. • Export to Outlook, Google Calendar, etc. • http://visitmix.com/lab/Oomph • http://codeplex.com/Oomph

  8. Demo + Code: Oomph

  9. The Purple is Your Code • http://msdn.microsoft.com/en-us/library/aa769764.aspx

  10. Adding Oomph to IE <script language="javascript" type="text/javascript" src="https://visitmix.com/labs/oomph/1.0/client/oomph.min.js"> </script> • Adding to Google Chrome with User Script • The same code in IE

  11. ZOMG!! C++?!? Oh, but it’s more than C++. You get ATL/COM!!!

  12. Can I use C# (or Python, etc.)? • Only one version of CLR per iexplore.exe • That means CLR 1.1 or 2.0 • Pay attention to breaking changes • Test both versions • Fail if wrong CLR version • You still need to interop with the C++ interfaces

  13. Like XUL, Only in C++ • IWebBrowser2 • IHTMLDocument2 • DWebBrowserEvents2 • HTMLDocumentEvents2

  14. Loading Your Add-On • Finds Your DLL in Registry and Loads it • In-Process With Iexplore.exe • One Instance Per Tab • First DllMain, then SetSite

  15. Step-By-Step • http://visitmix.com/university/lab_ieextensions.doc • http://codeplex.com/Oomph

  16. Sidebar UI • We Call it “Vertical Explorer Bar” or “Web Band” • Default is Win32, but You Should Use WebOC • WebOC is our Rendering Engine, Like Gecko • Use Web Standards in WebOC for UI • Sample Project

  17. Toolbar UI • Buttons: No Code Needed! But… • No Dynamic UI • No Split Button • No Forced Ordering • Tool Bands • All Win32

  18. Protected Mode • Low Integrity (iexplore.exe): Cannot Modify Anything but Temporary Internet Files Folder • Medium Integrity (default): Can Modify Anything Except Program and System Folders and Other Users’ Data • High Integrity (installers): Can Modify Anything

  19. Common Issues • Access System Resources from Add-On • Use DCOM to user-mode broker • Call Your Add-On from JavaScript • Use ActiveX Control • Like XPCOM • Step-by-Step Lab • Access System Resources from JavaScript • ActiveX + DCOM

  20. Common Issues • Web Services • Use Web Standards from AJAX (JSON, XML) • Persistence • Use cookies, Server State, or Plugin Library • Detect Tab Switching • Background Processing – Call Service Via DCOM

  21. Common Issues • Mixed Content • Local Machine Zone (LMZ) is Separate. Use (Mark of the Web) MOTW to Force Local Web Pages into Internet Zone • Non-SSL on SSL Throws Error: Use SSL, or don’t MIX • Intercept Networking Events (Headers, Cookies) • Can’t Do It • Security Companies Write Proxies

  22. Forums • http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=924&SiteID=1 • IE Team Active on Forums • Forums Being Migrated

  23. Testing and Debugging • Use IE8 on Vista • Most Restrictive Security • Good Developer Tools • IE7 Switcher • Visual Studio Elevated to Administrator • OutputDebugString • Test With Popular Toolbars Loaded

  24. Deployment • Use WiX v3 to create MSI • Need to Deploy DLL and Registry • Don’t do DllRegisterServer anymore • http://codeplex.com/Oomph • Per-User ActiveX

More Related