E-Book, Englisch, 417 Seiten
Crowley Pro Internet Explorer 8 & 9 Development
1. ed
ISBN: 978-1-4302-2854-7
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
Developing Powerful Applications for The Next Generation of IE
E-Book, Englisch, 417 Seiten
ISBN: 978-1-4302-2854-7
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
This book is an in-depth guide to writing applications that embrace and extend the new features and capabilities of Windows Internet Explorer 8 and 9. With solid instruction, hands-on examples, and expert insight direct from the source into extending the browser, you'll learn how to create and maintain powerful applications for Microsoft's next-generation Internet platform. Join author Matthew Crowley as you discover how to take advantage of new features like accelerators, WebSlices, and search providers, and create intense web experiences for the browser that ships by default with the popular Windows 7 operating system. If you're interested in creating and shipping high-quality, feature-rich applications for the Web, Pro Internet Explorer 8 & 9 Development is the only resource you need.
Matthew David Crowley is the program manager for developer community and tools on the Microsoft Internet Explorer team. In his role, he focuses on the development, implementation, and sustainment of features such as the IE Developer Tools, ActiveX, Protected Mode, and Behaviors. Before working at Microsoft, Matthew was an independent contractor and a developer for a variety of organizations. He earned a bachelor's degree in computer engineering from Case Western Reserve University in Cleveland, Ohio.
Autoren/Hrsg.
Weitere Infos & Material
1;Title Page;2
2;Copyright Page;3
3;Contents at a Glance;5
4;Table of Contents;6
5;About the Author;18
6;About the Technical Reviewer;19
7;Acknowledgments;20
8;Preface;21
8.1;What Will You Learn?;21
8.2;Who Should Read This Book?;21
8.3;How Is the Book Structured?;22
8.4;Additional Resources;22
9;CHAPTER 1 Internet Explorer Architecture;24
9.1;Application Architecture and Dependencies;24
9.1.1;Command-Line Parameters;26
9.1.2;Processor Support;27
9.1.3;Protected Mode (Low-Rights IE);27
9.1.4;Loosely Coupled Internet Explorer;30
9.1.4.1;Shared UI and Virtual Tabs;30
9.1.4.2;Crash Recovery;31
9.2;Browser Frame, Tabs, and UI;31
9.2.1;Search and Navigation;31
9.2.1.1;Address Bar and Navigation UI;31
9.2.1.2;The Smart Address Bar;32
9.2.1.3;Search Providers, Visual Search Providers, and the OpenSearch Specification;32
9.2.2;Printing;33
9.2.3;Tab Management;33
9.2.4;Favorites Center, Feeds, and History UI;33
9.2.4.1;Favorites UI and Favorites Bar;34
9.2.4.2;Feeds;34
9.2.4.3;History UI;34
9.2.5;Status and Notifications;34
9.2.5.1;Address Bar Notifications;34
9.2.5.2;Status Bar;35
9.2.5.3;Information Bar;35
9.2.5.4;Balloon Tips (Notifications);35
9.2.5.5;Modal Dialogs;36
9.2.5.6;Full-Page Notifications;36
9.2.6;Frame and Tab Extensibility;37
9.2.6.1;Toolbars;37
9.2.6.2;Explorer Bars;38
9.2.6.3;Accelerators and the OpenService Specification;38
9.2.6.4;Web Slices;39
9.2.6.5;Bookmarklets;40
9.2.6.6;Menu Extensions;40
9.2.6.7;Toolbar Buttons;41
9.2.6.8;Browser Helper Objects;41
9.3;Developer Tools;41
9.3.1;Script Errors and View Source;42
9.4;Shell Document View;42
9.4.1;The Travel Log and Shared Features;42
9.4.2;Trident (MSHTML);42
9.4.3;Third-Party and Custom Document Objects;42
9.5;Trident Layout and Rendering Engine;43
9.5.1;Parser Subsystem;44
9.5.2;Document Modes and Compatibility View;44
9.5.3;Core Document Subsystem;44
9.5.4;Text, Layout, and Rendering Subsystem;45
9.5.5;Object Model Subsystem;45
9.5.5.1;IE Dynamic HTML Object Model and W3C Document Object Model;45
9.5.5.2;Script Engine Interfacing (JScript.dll, VBScript.dll);45
9.5.5.3;Cross-Domain Request Objects (XMLHTTP, XMLHTTPRequest);46
9.5.5.4;Accessibility;46
9.5.6;Component Model Subsystem;46
9.5.6.1;Scripted and Binary Behaviors;46
9.5.6.2;ActiveX Controls;46
9.5.7;Editing Subsystem;47
9.6;Networking and Zones;47
9.6.1;URLMon;47
9.6.1.1;Zones and Security Managers;47
9.6.1.2;Pluggable Protocol Handlers;48
9.6.2;WinINET;48
9.7;Security, Trust, and Privacy Architecture;48
9.7.1;Security UI and Feedback Mechanisms;48
9.7.1.1;Information Bar;48
9.7.1.2;Badges;49
9.7.1.3;Full-Page Notifications;49
9.7.1.4;Protected Mode and UAC Dialogs;50
9.7.1.5;Status Bar Entry Points;50
9.7.2;Application Integrity and Browser Defenses;51
9.7.2.1;Protected Mode and Zones;51
9.7.2.2;DEP/NX and ASLR;51
9.7.3;Extension Integrity Defenses;51
9.7.3.1;ActiveX Safe for Initialization and Safe for Scripting;51
9.7.3.2;ActiveX Opt-In;52
9.7.3.3;ATL SiteLock Template and Per-Site ActiveX;52
9.7.3.4;Per-User (Non-Admin) ActiveX;53
9.7.3.5;Killbits and Phoenix Bits;53
9.7.3.6;Compatibility Warnings;54
9.7.4;Privacy and Social Engineering Protections;54
9.7.4.1;Window and Frame Restrictions;54
9.7.4.2;Malware and Phishing Filters;54
9.7.4.3;Platform for Privacy Preferences;55
9.7.4.4;Pop-Up Blocker;55
9.7.4.5;SSL, EV-SSL, and Identify Information;55
9.7.4.6;Domain Highlighting and IDN Spoofing Notifications;55
9.7.4.7;Cross-Domain Requests and postMessage;55
9.7.4.8;InPrivate Browsing and InPrivate Filtering;56
9.7.4.9;Cross-Site Scripting Filter;56
9.7.5;High-Integrity Brokers;56
9.7.5.1;ActiveX Installation Broker (ieinstal.exe);56
9.7.5.2;ActiveX Installer Service (axinstsv.exe);56
9.8;Hosting and Reuse;57
9.8.1;MSHTML;57
9.8.2;WebBrowser Control;57
9.8.3;HTML Applications;57
9.8.4;Scripting Interfaces and API Usage;57
9.9;Application Management Tools;58
9.9.1;Internet Explorer Administration Kit;58
9.9.2;Setup and the Windows 7 Uninstaller;58
9.9.3;Windows Error Reporting, Event Logging Infrastructure, and the Customer Experience Improvement Program;58
9.9.4;Windows 7 Troubleshooter;58
9.9.5;Default Programs;59
9.9.6;Online Services;59
9.10;Settings Management and Feature Controls;59
9.10.1;Internet Options Control Panel (inetcpl.cpl);59
9.10.2;Reset Internet Explorer Settings;59
9.10.3;Manage Add-Ons;60
9.10.4;Group Policy;60
9.10.5;Feature Control Keys;60
9.11;Summary;60
10;CHAPTER 2 Interoperability and Compatibility;61
10.1;Standards Support and Interoperability;61
10.1.1;HTML 4.01, HTML 5, and DOM Spec Support Improvements;61
10.2;Document Modes and Versioning;63
10.2.1;Quirks Mode, Document Modes, and X-UA-Compatible;63
10.2.2;Document Modes;64
10.2.3;Targeting Quirks Mode and Document Modes in Markup;64
10.2.4;Targeting Document Modes from the Server Side;65
10.2.4.1;Adding the X-UA-Compatible Header to IIS;65
10.2.4.2;Adding the X-UA-Compatible Header to Apache;66
10.2.5;Feature Controls for Document Modes;66
10.2.6;Differences Between IE 7 Standards Mode and True IE 7;67
10.3;Compatibility View;67
10.3.1;The Microsoft Compatibility View List;68
10.3.2;Controlling Compatibility Settings;68
10.4;Version Targeting;70
10.4.1;Version Targeting Using Conditional Comments;70
10.4.2;User Agent String Sniffing Using JavaScript;72
10.4.3;Compatibility View and the UA String;73
10.5;The Web Developer’s Dilemma;74
10.6;Summary;75
11;CHAPTER 3 Enriching Web Applications with AJAX and JSON;76
11.1;The XMLHttpRequest Object;76
11.1.1;The XMLHTTP Library and XMLHttpRequest Object;76
11.1.2;Native XMLHttpRequest;78
11.1.3;Cross-Browser AJAX Compatibility;78
11.2;Scripting and DOM Improvements;80
11.2.1;Native JSON Support;80
11.2.2;String Sanitization with toStaticHTML;83
11.2.3;Standards Compliance Improvements;86
11.2.3.1;Handling the addEventListener Method;86
11.2.3.2;Case Sensitivity in getElementById;87
11.2.3.3;Attribute Object Changes;88
11.3;Persisting Data with DOM Storage;93
11.3.1;DOM Storage and Subdomains;97
11.3.2;Securing Persisted Storage;99
11.3.3;Moving towards HTML 5 Storage;99
11.4;Networking and Connectivity;99
11.4.1;Online and Offline Events;99
11.4.2;XMLHttpRequest Timeout Events;101
11.4.3;AJAX Navigation Events;104
11.4.4;Concurrent Connections;108
11.5;Communicating Across Pages and Domains;110
11.5.1;Cross-Domain Requests;111
11.5.1.1;Building the Request;112
11.5.1.2;Building the Response;114
11.5.1.3;Putting it Together: The Request/Response Sequence;114
11.5.1.4;Building Interoperable Cross-Domain Requests;115
11.5.2;Cross Frame Messaging with postMessage();116
11.5.3;Tips and Tricks for Secure Communication;119
11.6;Summary;120
12;CHAPTER 4 Connecting Services with Accelerators;121
12.1;The What and Why of Accelerators;121
12.2;User Experience and Data Flow;122
12.3;The OpenService XML Schema;123
12.3.1;Variables;124
12.4;Creating Basic Accelerators;125
12.4.1;Constructing an Accelerator’s XML File;125
12.4.2;Constructing a Web Service Handler;126
12.5;Handling Accelerator Contexts;127
12.5.1;Using the Selection Context;128
12.5.2;Using the Link Context;129
12.5.3;Using the Document Context;130
12.6;Implementing Previews;131
12.7;Installation and Deployment;134
12.7.1;Installing and Deploying via JavaScript;134
12.7.1.1;Checking for Installed Accelerators;135
12.7.2;Installing and Deploying via Desktop Applications;135
12.7.2.1;Using the OpenService COM Interfaces;135
12.7.2.2;Accelerators and the Registry;137
12.7.3;Working with Categories and Defaults;143
12.8;Managing Accelerators;143
12.9;Advanced Topics;144
12.9.1;Updating Installed Accelerators;144
12.9.2;Building Rich Previews;145
12.9.3;Localizing Accelerators;147
12.9.4;Cross-Browser Integration;148
12.10;Best Practices for Building Accelerators;148
12.10.1;Providing Relevant Information;149
12.10.2;Designing Secure Accelerators;149
12.10.3;Designing Performant Accelerators;149
12.10.4;Designing Preview Web Pages;150
12.10.5;An Accelerator Design Checklist;150
12.11;Summary;150
13;CHAPTER 5 Debugging and Inspecting Pages with Developer Tools;151
13.1;Navigating the IE Developer Tools;151
13.1.1;View Source;152
13.1.2;The File Menu;153
13.2;Inspecting Markup;153
13.2.1;The HTML Tab and the DOM Explorer;153
13.2.2;The Attributes Pane;155
13.2.3;The Find, View, and Outline Menus;156
13.2.4;Exporting Changes;158
13.2.5;Markup Inspection in Action;158
13.3;Inspecting Layout and Styles;160
13.3.1;The Style Pane;160
13.3.2;The Trace Styles Pane;160
13.3.3;The Layout Pane;161
13.3.4;The Attributes Pane;162
13.3.5;The CSS Tab;162
13.3.6;CSS and Layout Inspection in Action;163
13.4;Using the Extended Toolset;165
13.4.1;The Disable Menu;165
13.4.2;The Images Menu;166
13.4.3;The Tools Menu;166
13.4.4;The Extended Toolset in Action;168
13.5;Testing for Compatibility and Interoperability;170
13.5.1;The Browser Mode and Document Mode Menus;170
13.5.2;The Validate Menu;171
13.6;Debugging JavaScript;172
13.6.1;The Script Tab;172
13.6.2;The Source Pane;173
13.6.3;Breakpoints and the Breakpoints Pane;174
13.6.4;The Locals, Watch, and Call Stack Panes;175
13.6.5;The Debugging Console Pane and the console Object;176
13.6.6;JavaScript Debugging in Action;180
13.7;JavaScript Measurement and Optimization;183
13.7.1;The JavaScript Profiler;183
13.7.2;The Profiler UI;183
13.7.3;Profile Views;184
13.7.4;Exporting Data;185
13.7.5;JavaScript Performance Testing in Action;186
13.8;Managing Cookies and the Cache;188
13.9;Tips for Debugging and Inspecting Web Sites;190
13.10;Summary;190
14;CHAPTER 6 Scripting with Mutable DOM Prototypes;191
14.1;A Primer: Prototypes, Properties, and the DOM;191
14.1.1;Prototypes;191
14.1.2;Properties (Getters and Setters);192
14.1.3;JavaScript and the DOM;193
14.2;Mutable Prototypes and Properties in IE 8;194
14.2.1;Manipulating DOM Objects;194
14.2.1.1;Adding New Functions;194
14.2.1.2;Accessing and Storing Built-In Functions;195
14.2.1.3;Wrapping Existing Functions;195
14.2.1.4;Deleting Custom Functions;195
14.2.2;Manipulating DOM Object Get and Set Properties;196
14.2.2.1;Creating New Properties;196
14.2.2.2;Accessing and Storing Built-In Properties;197
14.2.2.3;Wrapping Existing Properties;197
14.2.2.4;Deleting Custom Properties;198
14.2.2.5;Using Property Descriptors;198
14.3;IE Improvements in Practice;199
14.3.1;Downlevel IE Compatibility;199
14.3.1.1;Example: Reenabling Support for the className Attribute;199
14.3.2;Cross-Browser Interoperability;201
14.3.2.1;Example: Supporting Both textContent and innerText;201
14.3.3;Security and Sanitization;202
14.3.3.1;Example: Disabling document.write;202
14.3.3.2;Example: Automatically Sanitizing innerHTML Reads and Writes;204
14.3.4;Input Validation;205
14.3.4.1;Example: Input Validation for Forms;205
14.4;Summary;212
15;CHAPTER 7 Debugging and Inspecting Pages with Fiddler;213
15.1;Getting Started with Fiddler;213
15.1.1;Installing and Running Fiddler;213
15.1.2;Navigating the Fiddler User Interface;215
15.1.3;Scripting Fiddler with Rules;215
15.2;Viewing and Inspecting Sessions;217
15.2.1;Deciphering the Session List;217
15.2.2;Inspecting the Request-Response Sequence;218
15.2.3;Comparing Sessions;221
15.3;Filtering Sessions;222
15.3.1;Using the Top-Level Filter Commands;222
15.3.2;Using the Filters Tab;222
15.4;Debugging and Manipulating Sessions;225
15.4.1;Using the Request Builder;225
15.4.2;Using the Filters Tab to Modify Session Data;226
15.4.3;Setting and Using Breakpoints;226
15.5;Analyzing Site Performance;227
15.5.1;Quantifying Request Items, Types, and Times;228
15.5.2;Evaluating Cache Performance;230
15.5.3;Optimizing Compression Settings;231
15.5.4;Simulating Performance Scenarios Using Built-In Rules;232
15.6;Using Fiddler to Decrypt HTTPS Traffic;232
15.7;Grabbing Simple Captures with FiddlerCap;234
15.7.1;Installing and Running FiddlerCap;234
15.7.2;Capturing Traffic with FiddlerCap;235
15.8;Summary;236
16;CHAPTER 8 Content Syndication with Web Slices;237
16.1;Basics of Web Slices;237
16.1.1;Web Slice Structure: The hAtom Microformat;239
16.2;Designing and Deploying Basic Web Slices;240
16.2.1;Structuring and Creating a Web Slice;241
16.2.2;Installing and Viewing Web Slices;242
16.2.3;Managing Web Slices;244
16.3;Update and Expiry Management;245
16.3.1;Defining Update Intervals with TTL;245
16.3.2;Defining Expiration with the endtime Selector;247
16.4;Using CSS Styles and Stylesheets;250
16.4.1;Inline Styles and In-Document Stylesheets;250
16.4.2;Linked and Imported Styles;252
16.5;Alternative Sources;254
16.5.1;Alternative Update Source;254
16.5.2;Alternative Display Sources;255
16.5.2.1;Alternative Navigation Target;256
16.6;Authentication;257
16.6.1;Basic and Digest Authentication;257
16.6.2;Cookie-Based Authentication;258
16.7;Advanced Topics;258
16.7.1;Specifying a Page’s Default Web Slice;259
16.7.2;Script-Based Installation;259
16.7.3;Disabling In-Document Web Slice Advertisement;260
16.8;Summary;260
17;CHAPTER 9 Building Search Provider and Search Suggestion Extensions;261
17.1;Understanding Search Providers;261
17.2;The OpenSearch Description Format, JSON Search Suggestions, and XML Search Suggestions Specifications;264
17.2.1;OpenSearch Description Format Specification;264
17.2.1.1;OpenSearch Description Format Tags;266
17.2.1.2;Template Variables for the Tag;270
17.2.1.3;OpenSearch Extensions;272
17.2.2;JSON Search Suggestion Extension;272
17.2.3;XML Search Suggestion Extension;273
17.2.3.1;XML Search Suggestion Tags;274
17.3;Building a Basic Search Provider;276
17.4;Installing and Using Search Providers;276
17.5;Advertising Search Providers;278
17.6;Managing Search Providers;279
17.6.1;Returning Visual Suggestions with XML;280
17.7;Advanced Topics;280
17.7.1;Building Cross-Browser Search Providers;280
17.7.2;Adding Search Providers to the IE Add-Ons Gallery;281
17.7.3;User Preference Protection;284
17.8;Summary;285
18;CHAPTER 10 Building Lightweight Buttons and Menu Extensions;286
18.1;Understanding Lightweight IE Extensions;286
18.2;Adding Toolbar Buttons;288
18.2.1;Common Toolbar Button Properties;289
18.2.2;Running Script Using a Toolbar Button;290
18.2.3;Launching an Executable via a Toolbar Button;292
18.2.4;Invoking COM Objects via a Toolbar Button;294
18.2.5;Opening Explorer Bars with Toolbar Buttons;302
18.3;Extending the Tools and Help Menus;302
18.3.1;Common Menu Item Properties;302
18.3.2;Running Script Using a Menu Item;303
18.3.3;Launching an Executable via a Menu Item;306
18.4;Adding Entries to the In-Page Context Menu;308
18.4.1;Understanding the Context Menu Registry Structure;308
18.4.2;Example: Browser Selection Context Menu Extension;310
18.4.3;Turning Off the Context Menu;313
18.5;Creating Context Menus with JavaScript;313
18.6;Summary;317
19;CHAPTER 11 Developing Applications with the WebBrowser Control;318
19.1;Building a Simple WebBrowser Application;318
19.1.1;Preparing to Use the WebBrowser Control;318
19.1.2;Creating an Instance of the WebBrowser Control (AxWebBrowser);320
19.1.3;Handling Basic Events;322
19.2;Accessing the Object Model;323
19.2.1;Attaching to Document and Window Objects;324
19.2.2;Accessing the Browser Object Model;325
19.2.3;Sinking Object Model Events;326
19.3;Achieving Tight Integration with IE;327
19.3.1;Setting Up the Application;328
19.3.2;Integrating WebBrowser Events with the IE UI;328
19.3.3;Mimicking Window Behavior of IE;329
19.3.4;Surfacing and Executing OLE Commands;330
19.4;Summary;333
20;CHAPTER 12 Enhancing Page Content with Managed ActiveX Controls;334
20.1;Getting to Know ActiveX Controls;335
20.2;Architecting a Basic Control in .NET;335
20.2.1;Designing the Public Interface;335
20.2.2;Building the Control;338
20.2.3;Signing the Control;339
20.2.4;Running the Control;340
20.3;Constructing UIs;342
20.3.1;Adding a UI to a Managed Control;342
20.3.2;Setting a Control’s OLE UI Flags;345
20.4;Exposing Events to ActiveX Hosts;345
20.4.1;Creating the Event Interface;345
20.5;Practicing Safe ActiveX with IObjectSafety;348
20.5.1;Staying Safe in the Great IUnknown;348
20.5.2;Implementing IObjectSafety;349
20.6;Looking At Alternative Platforms and Technologies;351
20.7;Summary;351
21;CHAPTER 13 Building In-Process Extensions with Browser Helper Objects;352
21.1;Understanding BHOs;352
21.2;Building a Generic BHO;354
21.3;Registering and Running BHOs;356
21.4;Sinking Browser Events;358
21.5;Summary;361
22;CHAPTER 14 Extending the Browser Frame Using Band Objects;362
22.1;Understanding Band Objects;362
22.2;Building a Generic Band Object;364
22.3;Registering Band Objects;370
22.4;Constructing a Toolbar;374
22.5;Constructing a Vertical Explorer Bar;376
22.6;Constructing a Horizontal Explorer Bar;379
22.7;Summary;381
23;CHAPTER 15 Scripting and Automating Internet Explorer;382
23.1;Using IE with the Command Line;382
23.1.1;Getting to Know the IE Command Line;382
23.1.2;Changing IE Registry Settings;383
23.1.3;Invoking IE APIs Using RunDLL32;384
23.2;Writing Basic Scripts for IE;386
23.2.1;Creating IE Objects with the Windows Scripting Host;386
23.2.2;Creating IE Objects with PowerShell;387
23.2.3;Sinking Events Using VBScript and CreateObject;387
23.2.4;Learning Common IE Scripting Techniques by Example;388
23.2.4.1;Setting Basic Window Properties (VBScript);388
23.2.4.2;Opening Multiple Tabs in a Single Window (JScript);389
23.2.4.3;Accessing the Document Object and Finding All Links (VBScript);390
23.2.4.4;Setting a Home Page Using Windows Management Instrumentation (VBScript);391
23.3;Summary;392
24;Index;393




