Building add ons that work cross browser joshua allen joshuaa@microsoft com
This presentation is the property of its rightful owner.
Sponsored Links
1 / 24

From Firefox to IE PowerPoint PPT Presentation


  • 51 Views
  • Uploaded on
  • Presentation posted in: General

Building Add- Ons that Work Cross-Browser Joshua Allen <[email protected]>. 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

Download Presentation

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Building add ons that work cross browser joshua allen joshuaa@microsoft com

Building Add-Ons that Work Cross-Browser

Joshua Allen <[email protected]>

From Firefox to IE


Why did you start with firefox

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

Why Port to IE?

  • Bigger Market Share

  • More Mainstream Users

  • Higher Bar to Entry for Your Competitors


The web is about interop

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


Creating your add on

Creating Your Add-On

  • Design

  • Build

  • Test

  • Deploy


Design

Design

  • Use Web Standards

  • Consider Slices and Accelerators


An idealistic example oomph

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


Demo code oomph

Demo + Code: Oomph


The purple is your code

The Purple is Your Code

  • http://msdn.microsoft.com/en-us/library/aa769764.aspx


Adding oomph to ie

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


Zomg c

ZOMG!! C++?!?

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


Can i use c or python etc

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


Like xul only in c

Like XUL, Only in C++

  • IWebBrowser2

  • IHTMLDocument2

  • DWebBrowserEvents2

  • HTMLDocumentEvents2


Loading your add on

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


Step by step

Step-By-Step

  • http://visitmix.com/university/lab_ieextensions.doc

  • http://codeplex.com/Oomph


Sidebar ui

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


Toolbar ui

Toolbar UI

  • Buttons: No Code Needed! But…

    • No Dynamic UI

    • No Split Button

    • No Forced Ordering

  • Tool Bands

    • All Win32


Protected mode

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


Common issues

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


Common issues1

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


Common issues2

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


Forums

Forums

  • http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=924&SiteID=1

  • IE Team Active on Forums

  • Forums Being Migrated


Testing and debugging

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


Deployment

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


  • Login