Programming To Cope With Web Browser Settings Blood, Sweat and Tearful tantrums no more (ideally) {### this will become a web page with comments from a web programming point-of-view ###} (C) Friday 14th July 2006 Kevin P. Markwell for Obelisk Programming Systems _Contents Abstract Dealing with some of the problems Internet Options (from the menu "Tools", then "Internet Options") Customizing the browser _Abstract To anyone trying to write programs that run in or from web browsers. I wrote this because programmers need to work-around so much with the operating system and/or hardware platform that fighting with the browser and user preferences can drive them madder. I thought I'd try to help save other geeks from going bald. Of course, we geeks don't care if we go bald, but pulling our hair hurts. I rub my head a lot when coding, nearly as good as a stress ball. To reduce tedium, I'll hyperlink details/waffles/rants. If you can't follow me so far, this won't be for you. _"Who is this geek?"_ _Dealing with some of the problems All kinds of people want to use the internet, many will save time by going on what seems to be the simplest route, that is, getting a PC, sticking with Windoze, sticking with IE, sticking with it's defaults, trying to do new stuff on the web. Simple version - people ->- PC ->- web ->- fun/interest/need The "people->-PC" bit is not our thing, that's down to people and teachers. The "PC->-web" bit is dealt with by people, system builders (more or less), sharks, and nutters The "web->-fun" bit is dealt with by a multi-billion dollarpound game industry. If their games don't run, they'll just lean on the problem company. The "web->-interest" bit is us. The "web->-need" bit is also us. This explains the hair-pulling. Window$ has the software choice edge for users, I know the awesome Linux has emulators, and apparently I could write my own drivers, but even I can't get interested in all that. Internet Explorer is still with Window$, don't get me started on the legal stuff, and what if Bu$h hadn't won the first time. The Internet Options in IE are rubbish (in American, they suck big time). HTML For HTML pages, including DHTML, XHTML and of course DXHTML, the Internet options are annoying. It's possible, if certain settings are changed, to make any web page invisible or unusable, even well-coded ones. IE can therefore be changed from a browser into a virtual piece of cardboard. Refer to the Internet Options section, I'll go through the crucial ones here. ### Javascript ### Java Support for Java is Pathetic in several ways, so what can be done? Firstly, the Run-time Environment thing. It requires a bit of downloading, and the best source or originator is generally Sun, but billions of people have never heard of them. Here's the typical user scenario (with a commentary): the user gets fairly clued up about the internet ( another geek joins the fray :-D ) also hears about Java games on mobile phones ( advertising is really "subvertising" ) sees some sites saying Java stuff is available ( gets curiousity ) tries to run Java stuff and gets asked about downloading ( gets skepticism ) persists and gets routed to a site like Sun's ( gets confusion ) Internet Explorer hassles the user about verification, authentication, and restarting ( gets worry/panic/broken IE/broken OS ) some users might get it going, then are asked more questions they'd prefer to answer "no" to ( loses confidence, Java development slows down further ) Solution: 1. You should describe, simply, the Run-time Environment on the same page of your website. 2. Say how why it's worth it (check your Applet/Application is worth it by asking someone else), how big it is, how long (roughly) it should take to download, and what you've done to protect it from viruses and spyware. 3. Say what to do once it's downloaded, include multiple help files (txt&doc&html&rtf) saying the same thing as the page does. Get other people to check they can do it, watching them the whole time, taking notes, but not helping them. 3. Add a decent link to a your read-only copy of it in the same folder on the same server as your web page. 4. Keep the version up-to-date, avoid getting into offering multiple versions, other editions and other servers. 5. Add a forum so more experienced people can help newbies through it. That way, you don't end up doing all the tech support. Secondly, the Permissions thing Get familiar with PolicyTool, it's clumsy, but useful for testing. Your program (whether an applet or application), should be trying not to upset the user's browser, nor their hard disc. After months of pondering and research, I designed my big apps in the following ways: 1. Downloading is minimalist. To me, this means that a new module or data takes as little time as possible by being in small pieces (discreetly), is done whenever the user is busy with something else (discretely), and is only what is really needed (sensibly). I've also got everything packaged up to work offline if the user chooses to grab it in one lump (they might not get on the internet very often, or have dial-up). For my multi-user, shared database app, this was Difficult. 2. Nothing is saved locally, not even cookies. Even users who understand cookies might have lost them, or accidently turned them off. They cannot be relied on, use them just for simple stuff, like welcoming them back and server-counting their visit, nothing more. Any data the user creates or causes should be saved on the server straight away. If your program needs other details in order to save it in the right place, store it temporarily, and code for it to be picked up automatically. This is hard to design, but it's worth it, I now have my app with the almost-unheard-of feature of "no need to save". 3. Nothing is read locally, ### 4. No manual downloading, none of the "Open" or "Save to disk" bother.### 5. Learn from some of the Java games that play straight away. Look at what their doing, and how much permission setting and downloading they avoid. 6. Most PCs that can get on the internet run fairly fast. With efficient coding and finding out the draining bits, you could code your stuff so that it doesn't use the flashiest classes, but still looks like it does. The games industry fakes it all the time, look at the source of Quake Arena (freely available) to get an idea of the shortcuts they used to make it look 3D. Thirdly, the Editions thing ### To me, Java3D sounded fantastic, I thought it'll probably have VRML too, such disappointment. The Java Run-time Environment to run everything could get bigger. The Java Media Framework looks great, but yet another big download for the user. The user would sqeak "I thought I already had Java?". ### Fourthly, the Sun thing It says it comes from Sun, which is fine, but the problem is where it links to. ### Solution: 1. Provide information on your own pages to describe what it means. ### Fifthly, the features thing Your program could have some nifty but highly demanding code. Make sure the features are fairly independent, by what I call "over-coding". For example, say you write an online word-processor that stores the document online for the user. Don't just rely on an array of the document being in memory, but write a common routine for checking the document's array (say, by checksum), and get each functional routine (e.g. "Outline view" or "Print") to call that routine first. If the array test fails, don't just throw an error apologising to the user, but get that common routine to try to reload it in at least two different ways, such as streamed and byte-by-byte. When you think about it, it can give better error detection when it first gets loaded too. This common routine could be called "getDocumentEitherFromArrayWithCheckingFirstOrOffDiskSomehow", or maybe just "grabDoc". ### _Internet Options (from the menu "Tools", then "Internet Options") Although the options are based on Internet Explorers from v5 to v7, and the superb FireFox, there will always be similar options to these, because of the nature of the internet. The full list, with comments: General: Temporary Internet files -> Settings... Check for newer versions of stored pages = Automatically Move Folder History Days to keep pages in Colors Use Windows colors = checked Use hover color Fonts Language script = Latin based Web page font = Times New Roman Plain text font = Courier New Languages Language = English (United Kingdom) [en-gb] {Menus and dialog boxes are currently displayed in English (United States) } Accessibility Formatting Ignore colors specified on Web pages Ignore font styles specified on Web pages Ignore font sizes specified on Web pages User style sheet Format documents using my style sheet Security: Custom Level... ActiveX controls and plug-ins Download signed ActiveX controls = Prompt Download unsigned ActiveX controls = Disable Initialize and script ActiveX controls not marked as safe = Disable Run ActiveX controls and plug-ins = Enable Script ActiveX controls marked safe for scripting = Enable Cookies Allow cookies that are stored on your computer = Enable Allow per-session cookies (not stored) = Enable Downloads File download = Enable Font download = Enable Microsoft VM Java permissions = high safety Miscellaneous Access data sources across domains = Disable Drag and drop or copy and paste files = Enable Installation of desktop items = Prompt Launching programs and files in an IFRAME = Prompt Navigate sub-frames across different domains = Enable Software channel permissions = medium safety Submit nonencrypted form data = Enable Userdata persistence = Enable Scripting Active scripting = Enable Allow paste operations via script = Enable Scripting of Java applets = Enable User authentication Logon Automatic logon only in Intranet zone Content Content Advisor -> Enable... Ratings Approved Sites General Users can see sites that have no rating Supervisor can type a password to allow users to view restricted content Connections Settings LAN Settings Programs E-mail: Outlook Express Internet Explorer should check to see whether it is the default Advanced Accessibility Always expand ALT text for images Move system caret with focus/selection changes Browsing Always send URLs as UTF-8 = checked Automatically check for Internet Explorer updates Close unused folders in History and Favorites Disable script debugging = checked Display a notification about every script error Enable folder view for FTP sites = checked Enable Install On Demand Enable offline items to be synchronized on a schedule Enable page hit counting = checked Enable page transitions = checked Enable Personalized Favorites Menu Notify when downloads complete = checked Reuse windows for launching shortcuts = checked Show friendly HTTP error messages Show friendly URLs Show Go button in Address bar Show Internet Explorer on the desktop Underline links = Always Use inline AutoComplete Use smooth scrolling = checked HTTP 1.1 settings Use HTTP 1.1 = checked Use HTTP 1.1 through proxy connections Microsoft VM Java console enabled (requires restart) Java logging enabled JIT compiler for virtual machines enable (requires restart) = checked Multimedia Always show Internet Explorer (5.0 or later) Radio toolbar Play animations Play sounds Play videos Show image download placeholders Show pictures = checked Smart image dithering = checked Printing Print background colours and images Search from the Address bar When searching = blank Security Check for publisher's certificate revocation = checked Check for server certificate revocation (requires restart) Do not save encrypted pages to disk Empty Temporary Internet Files folder when browser is closed Enable Profile Assistant = checked Use Fortezza = checked Use PCT 1.0 Use SSL 2.0 = checked Use SSL 3.0 = checked Use TLS 1.0 Warn about invalid site certificates = checked Warn if changing between secure and not secure mode Warn if forms submittal is being redirected = checked _Customizing the browser ----------------------------------------------------------------------------------------------------