Altså noget i denne stil:
Filen hedder browserinfo.asp og er lavet at Cyscape com har et program der hedder BrowserHawk.
http://www.cyscape.com/ link \"browser troubleshooting scrip\"
<%
\' browserInfo.asp
\' created by cyScape, Inc.
\' 01/23/2001
\' version 1.01
\' - changed all occurances of chr(10) to chr(13) & chr(10) to make it compatible with all email systems.
\' - user agent string now included at the top of the browser details list in the email sent as well as the form shown to the end user.
\' 10/03/2000
\' version 1.0
\' original version - all code new
\' Permission to use and modify the contents of this script for your own purposes is hereby granted
\' provided you have a licensed or active evaluation copy of BrowserHawk on the machine this script is used on.
\' Copyright (c) 2000 cyScape, Inc. All rights reserved.
\' The purpose of this script is to automatically collect details about a visitor\'s browser to
\' assist with the troubleshooting of browser compatibility issues reported. By default this script
\' collects information on browser type and version, installed plug-ins, disabled cookies/JavaScript/applets,
\' screen size, color depth, and much more.
\'
\' NOTE: THIS SCRIPT IS AN EXAMPLE TO HELP YOU GET UP AND RUNNING QUICKLY WITH A BROWSER TROUBLESHOOTING PAGE.
\' HOWEVER THERE ARE MANY REFINEMENTS YOU SHOULD CONSIDER BEFORE USING IT ON A PRODUCTION WEB SITE, SUCH AS FORM
\' VALIDATION, BETTER ERROR HANDLING, AND PAGE LAYOUT TO MATCH THE LOOK AND FEEL OF YOUR SITE.
\' Let\'s see if we\'re being called back to process the user\'s form and email out the results
if UCase(Request.ServerVariables(\"REQUEST_METHOD\")) = \"POST\" then
\'Process the results
ProcessResults
\'Our work is complete and the \'thank you\' screen has been displayed. We must end the request here.
Response.end
end if
\'some constants for use with the plugin detector
const BH_EXTPROP_NONE = -1
const BH_EXTPROP_FLASH = 1
const BH_EXTPROP_DIRECTOR = 2
const BH_EXTPROP_MEDIAPLAYER = 4
const BH_EXTPROP_REALPLAYER = 8
const BH_EXTPROP_QUICKTIME = 16
const BH_EXTPROP_ACROBAT = 32
BH_EXTPROP_ALL = BH_EXTPROP_FLASH + BH_EXTPROP_DIRECTOR + BH_EXTPROP_MEDIAPLAYER + BH_EXTPROP_REALPLAYER + BH_EXTPROP_QUICKTIME + BH_EXTPROP_ACROBAT
\'------------------- USER CONFIGURATION BEGIN -------------------
\' PLEASE READ THROUGH THIS SECTION AND SET VARIABLES AS APPROPRIATE FOR YOUR DESIRED USAGE.
\'STEP 1
\'------
\'Note we specifically don\'t test for acrobat since it causes IE to load the Acrobat splash screen.
\'This is a minor side effect if you need to know whether Acrobat is installed. However we don\'t test
\'for it by default for this reason. If you wish to test for Acrobat change the following variable to True
testAcrobat = False
\'STEP 2
\'------
\'By default we test the user\'s connection speed. If you are not interested in this however you should change
\'the variable below to False
testConnectionSpeed = True
\'STEP 3
\'------
\'In addition to the main properties we display to the end user and email back to us, it may be helpful for
\'you to have a full dump of all the browser property settings. By default we collect this additional
\'information, and although it is not shown to the end user it is transmitted back to us when the user
\'submits the troubleshooting form. If you are not interested in this extra information, set the
\'following variable to False
collectAllDetails = True
\'STEP 4
\'------
\'Go to the EMAIL CONFIGURATION SECTION located in the ProcessResults function found in this file
\'to set up your email options so the browser settings can be emailed back to you.
\'------------------- USER CONFIGURATION END -------------------
on error resume next
set objBrowser = Server.CreateObject(\"cyScape.browserObj\")
if err.number = -2147221005 then
%>
<html><body><h2>BrowserHawk not installed</h3>
In order to use this script you must have cyScape\'s BrowserHawk component installed on the web server that this
script is executing on. If you already have a copy of BrowserHawk, please install it. Otherwise
visit the <a href=\"
http://www.cyscape.com/\">cyScape web site</a> and <a href=\"
http://www.cyscape.com/products/bhawk/download.asp\">download the free, fully functional evaluation</a> of BrowserHawk and install it.</body></html>
<%
response.end
elseif err.number then
%>
<html><body><h2>Error occurred</h2>The following error occurred when trying to create the BrowserHawk object: Error #<%=err.number%><BR>Desc: <%=err.description%>
</body></html>
<%
response.end
end if
on error goto 0
\'first let\'s check for disabled cookies
\'Note: If you decide to switch your cookies settings back and forth between enabled and disabled for
\'testing purposes make certain to delete all your cookies and shutdown/restart the browser before each test.
objBrowser.CookieDetector \"noredirect\"
\'Let\'s get the extended properties including enabled/disabled javascript/cookie/applet settings,
\'screen size, plugins, color depth and more.
\'Note that there are several optional parameters for this method - see the BrowserHawk documentation
\'for important details including how to make this checking look seamless with your site if you change the background color.
\'To enable Acrobat detection check the comments at the top of this code block.
pageMsg = \"\"
if objBrowser.Browser = \"IE\" then
\'The call to GetExtProperties can take a few seconds to execute under IE
\'and certain conditions. Therefore if its IE then we\'ll put up this message in the browser window
\'but if its another browser like Netscape we don\'t bother
pageMsg = \"Checking your browser. Please wait...\"
end if
if testAcrobat then
pluginList = BH_EXTPROP_ALL
else
pluginList = BH_EXTPROP_ALL - BH_EXTPROP_ACROBAT
end if
objBrowser.GetExtProperties \"\", \"Checking your browser. Please wait...\", pluginList, False, pageMsg
\'Test following tests the users connection speed. If you are not interested in this test then remove this code block.
if testConnectionSpeed AND objBrowser.JavaScriptEnabled then
objBrowser.SpeedDetector \"\", \"Please wait...\", \"Checking connection speed. Please wait...\"
end if
browJavaScriptCapable = objBrowser.JavaScript
browType = objBrowser.Browser
browVersion = objBrowser.fullVersion
browPlatform = objBrowser.platform
browCookiesCapable = objBrowser.cookies
\'The translate method is used to tell BrowserHawk to translate the BrowserHawk property value into a descriptive string
\'which explains the meaning of that property. For example, the Plugin_Real property returns an integer depending on
\'the real player installed. Calling the Translate method and passing in the name of the property as the key to the
\'method results in BrowserHawk giving you back what that integer means. To demonstrate - the Plugin_RealPlayer property
\'may equal 3 - calling the Translate property will return \"RealPlayer G2 installed\". Likewise if the Plugin_RealPlayer
\'was equal to -1 it would return \"Not available with this browser\" or \"Not available with JavaScript disabled\" or
\'other messages depending on the circumstances. In short the Translate method is useful to translate property values
\'into their meaning. As another example using the key \"ScreenSize\" will have BrowserHawk return a string such as
\' \"800 x 600\" instead of you having to build this yourself using the Height and Width properties and saves you from
\'having to account for situations where values are 0 or not available.
browCookiesEnabled = objBrowser.Translate(\"Cookies\")
browJavaScriptEnabled = objBrowser.JavaScriptEnabled
browScreenSize = objBrowser.Translate(\"ScreenSize\")
browBrowserSize = objBrowser.Translate(\"BrowserSize\")
browAppletsCapable = objBrowser.JavaApplets
browAppletsEnabled = objBrowser.Translate(\"JavaApplets\")
browPluginFlash = objBrowser.Translate(\"Plugin_Flash\")
browPluginShockwave = objBrowser.Translate(\"Plugin_Director\")
browPluginMediaPlayer = objBrowser.Translate(\"Plugin_MediaPlayer\")
if testAcrobat then
browPluginAcrobat = objBrowser.Translate(\"Plugin_Acrobat\")
else
browPluginAcrobat = \"Not tested by default\"
end if
browPluginRealPlayer = objBrowser.Translate(\"Plugin_RealPlayer\")
browPluginQuickTime = objBrowser.Translate(\"Plugin_QuickTime\")
if testConnectionSpeed then
browConnectionSpeed = objBrowser.Translate(\"ConnectionSpeed\")
else
browConnectionSpeed = \"Not tested by default\"
end if
browConnectionType = objBrowser.Translate(\"ConnectionType\")
browColorDepth = objBrowser.Translate(\"ColorDepth\")
allDetails = \"Not configured to collect additional details\"
if collectAllDetails then
allDetails = \"\"
for each prop in objBrowser
allDetails = allDetails & prop & \": \" & objBrowser(prop) & chr(13) & chr(10)
next
end if
%>
<HTML><HEAD><TITLE>Browser troubleshooting tool</TITLE></HEAD>
<BODY>
<BLOCKQUOTE>
The purpose of this page is to collect information from you that
will assist us in troubleshooting the problem you are having.
Details about your browser have been collected for you automatically and are displayed
in the table below. Please answer the following questions and press the Report Issue button.
A support representative will contact you shortly.
<P>
<%
\'Note: The GetExtProperties, CookieDetector, and SpeedDetector methods can not be used
\'from script executing from within a POST request. Otherwise the Request object and all form
\'values will be emptied. Therefore we call these methods above during our initial GET request,
\'and pass the values we need to the POST request processing via hidden form field variables.
%>
<form method=\"POST\" action=\"browserinfo.asp\">
<table>
<tr><td align=right>Name:</td><td><input type=\"text\" name=\"name\" size=\"30\"></td></tr>
<tr><td align=right>Email:</td><td><input type=\"email\" name=\"email\" size=\"30\"></td></tr>
<tr><td align=right>Description<br>of problem:</td><td><textarea rows=\"3\" name=\"desc\" cols=\"40\"></textarea></td></tr>
<tr><td> </td><td align=left><input type=\"submit\" value=\"Report issue\" name=\"B1\"></td></tr>
</table>
<input type=\"hidden\" name=\"browTypeAndVer\" value=\"<%=browType & \" \" & browVersion%>\">
<input type=\"hidden\" name=\"browPlatform\" value=\"<%=browPlatform%>\">
<input type=\"hidden\" name=\"browCookiesCapable\" value=\"<%=browCookiesCapable%>\">
<input type=\"hidden\" name=\"browCookiesEnabled\" value=\"<%=browCookiesEnabled%>\">
<input type=\"hidden\" name=\"browJavaScriptCapable\" value=\"<%=browJavaScriptCapable%>\">
<input type=\"hidden\" name=\"browJavaScriptEnabled\" value=\"<%=browJavaScriptEnabled%>\">
<input type=\"hidden\" name=\"browAppletsCapable\" value=\"<%=browAppletsCapable%>\">
<input type=\"hidden\" name=\"browAppletsEnabled\" value=\"<%=browAppletsEnabled%>\">
<input type=\"hidden\" name=\"browScreenSize\" value=\"<%=browScreenSize%>\">
<input type=\"hidden\" name=\"browBrowserSize\" value=\"<%=browBrowserSize%>\">
<input type=\"hidden\" name=\"browConnectionType\" value=\"<%=browConnectionType%>\">
<input type=\"hidden\" name=\"browConnectionSpeed\" value=\"<%=browConnectionSpeed%>\">
<input type=\"hidden\" name=\"browColorDepth\" value=\"<%=browColorDepth%>\">
<input type=\"hidden\" name=\"browPluginFlash\" value=\"<%=browPluginFlash%>\">
<input type=\"hidden\" name=\"browPluginShockwave\" value=\"<%=browPluginShockwave%>\">
<input type=\"hidden\" name=\"browPluginMediaPlayer\" value=\"<%=browPluginMediaPlayer%>\">
<input type=\"hidden\" name=\"browPluginRealPlayer\" value=\"<%=browPluginRealPlayer%>\">
<input type=\"hidden\" name=\"browPluginAcrobat\" value=\"<%=browPluginAcrobat%>\">
<input type=\"hidden\" name=\"browPluginQuickTime\" value=\"<%=browPluginQuickTime%>\">
<input type=\"hidden\" name=\"browAllDetails\" value=\"<%=allDetails%>\">
</form>
<b>Important</b>: If you change any browser settings you must <a href=\"<%=request.serverVariables(\"SCRIPT_NAME\")%>\"><b>click here</b></a><br>
to refresh this data instead of hitting your Reload button.<p>
<% response.write \"<font size=-1>User agent: \" & Request.ServerVariables(\"HTTP_USER_AGENT\") & \"</font><P>\" %>
<TABLE bgcolor=\"#CCCCCC\" BORDER=1 cellpadding=5 cellspacing=2>
<TR bgcolor=\"#FFFFFF\"><TD>Browser type and version</TD> <TD><% =browType & \" \" & browVersion %></TD></TR>
<TR bgcolor=\"#F0F0F0\"><TD>Platform</TD> <TD><% =browPlatform %></TD></TR>
<TR bgcolor=\"#FFFFFF\"><TD>Cookies supported</TD> <TD><% =browCookiesCapable %></TD></TR>
<TR bgcolor=\"#F0F0F0\"><TD>Cookies enabled</TD> <TD><% =browCookiesEnabled %></TD></TR>
<TR bgcolor=\"#FFFFFF\"><TD>JavaScript supported</TD> <TD><% =browJavaScriptCapable %></TD></TR>
<TR bgcolor=\"#F0F0F0\"><TD>JavaScript enabled</TD> <TD><% =browJavaScriptEnabled %></TD></TR>
<TR bgcolor=\"#FFFFFF\"><TD>Java applets supported</TD> <TD><% =browAppletsCapable %></TD></TR>
<TR bgcolor=\"#F0F0F0\"><TD>Java applets enabled</TD> <TD><% =browAppletsEnabled %></TD></TR>
<TR bgcolor=\"#FFFFFF\"><TD>Screen size</TD> <TD><% =browScreenSize %></TD></TR>
<TR bgcolor=\"#F0F0F0\"><TD>Browser size</TD> <TD><% =browBrowserSize %></TD></TR>
<TR bgcolor=\"#FFFFFF\"><TD>Connection type</TD> <TD><% =browConnectionType %></TD></TR>
<TR bgcolor=\"#F0F0F0\"><TD>Connection speed</TD> <TD><% =browConnectionSpeed %></TD></TR>
<TR bgcolor=\"#FFFFFF\"><TD>Color depth</TD> <TD><% =browColorDepth %></TD></TR>
<TR bgcolor=\"#F0F0F0\"><TD>Flash</TD> <TD><% =browPluginFlash %></TD></TR>
<TR bgcolor=\"#FFFFFF\"><TD>Shockwave</TD><TD><% =browPluginShockwave %></TD></TR>
<TR bgcolor=\"#F0F0F0\"><TD>MediaPlayer</TD> <TD><% =browPluginMediaPlayer %></TD></TR>
<TR bgcolor=\"#FFFFFF\"><TD>RealPlayer</TD><TD><% =browPluginRealPlayer %></TD></TR>
<TR bgcolor=\"#F0F0F0\"><TD>Acrobat</TD> <TD><% =browPluginAcrobat %></TD></TR>
<TR bgcolor=\"#FFFFFF\"><TD>QuickTime</TD> <TD><% =browPluginQuickTime %></TD></TR>
</TABLE>
</BODY></HTML>
<%
Function ProcessResults()
\'Our results processing consists of formatting an email message to contain the results
\'and then sending it to a support representative for follow up. You of course can
\'easily modify this to write the information to a file or database as well.
\'---- EMAIL CONFIGURATION SECTION -----
\'By default this script is programmed to email the test results back to you (or your support group) using the free
\'Persist ASPEmail component. Before submitting the form written out by this script please be sure to install this
\'email component or if you prefer you can easily modify this script to use whatever email component you like - just
\'update the ProcessResults function found lower in the source accordingly.
\'Set this to the address where you want the script to email the browser test results to
emailToAddr = \"someone@somewhere.com\"
\'Set this to the address of your SMTP server
emailSmtpServer = \"smtp.somewhere.com\"
\'After you have edited the above two variables change the emailConfigured variable below to True
emailConfigured = False
\'---- END EMAIL CONFIGURATION SECTION -----
crlf = chr(13) & chr(10)
crlf2 = crlf & crlf
results = \"The following submission was made on \" & Now & \":\" & crlf2
results = results & \" Name: \" & Request.Form(\"name\") & crlf
results = results & \" Email: \" & Request.Form(\"email\") & crlf2
results = results & \" Problem description: \" & Request.Form(\"desc\") & crlf2
results = results & \" User agent: \" & Request.ServerVariables(\"HTTP_USER_AGENT\") & crlf2
results = results & \" Browser: \" & Request.Form(\"browTypeAndVer\") & crlf
results = results & \" Platform: \" & Request.Form(\"browPlatform\") & crlf2
results = results & \" Cookies supported: \" & Request.Form(\"browCookiesCapable\") & crlf
results = results & \" Cookies enabled: \" & Request.Form(\"browCookiesEnabled\") & crlf2
results = results & \" JavaScript supported: \" & Request.Form(\"browJavaScriptCapable\") & crlf
results = results & \" JavaScript enabled: \" & Request.Form(\"browJavaScriptEnabled\") & crlf2
results = results & \" Applets supported: \" & Request.Form(\"browAppletsCapable\") & crlf
results = results & \" Applets enabled: \" & Request.Form(\"browAppletsEnabled\") & crlf2
results = results & \" Screen size: \" & Request.Form(\"browScreenSize\") & crlf
results = results & \" Browser size: \" & Request.Form(\"browBrowserSize\") & crlf
results = results & \" Color depth: \" & Request.Form(\"browColorDepth\") & crlf2
results = results & \" Connection speed: \" & Request.Form(\"browConnectionSpeed\") & crlf
results = results & \" Connection type: \" & Request.Form(\"browConnectionType\") & crlf2
results = results & \" Flash: \" & Request.Form(\"browPluginFlash\") & crlf
results = results & \" Shockwave: \" & Request.Form(\"browPluginShockwave\") & crlf
results = results & \" MediaPlayer: \" & Request.Form(\"browPluginMediaPlayer\") & crlf
results = results & \" RealPlayer: \" & Request.Form(\"browPluginRealPlayer\") & crlf
results = results & \" Acrobat: \" & Request.Form(\"browPluginAcrobat\") & crlf
results = results & \" QuickTime: \" & Request.Form(\"browPluginQuickTime\") & crlf2
results = results & \"Dump of all property settings: \" & crlf
results = results & Request.Form(\"BrowAllDetails\")
if NOT emailConfigured then
response.write \"<B>Configuration necessary</B><BR>Please see the source of this script to configure the email options. If you have already done so, change the emailConfigured variable to True.</body></html>\"
response.end
end if
on error resume next
Set objEmail = Server.CreateObject(\"Persits.MailSender\")
if err.number = -2147221005 then
%>
<B>Error - mail component not installed</B><P>
This script is designed to use Persist\'s ASPEmail component which is not installed on this machine.
This component is available for free from the <a href=\"
http://www.aspemail.com/\" TARGET=\"_NEW\">ASPEmail web site</A>.
Please download and install this component on your web servers where the BrowserHawk component resides.
Or if you prefer, you can easily modify the source of this script to use whatever email component you may already have installed.
</body></html>
<%
response.end
elseif err.number then
response.write \"<B>Error occurred: #\" & err.number & \" err.description\" & \"</body></html>\"
response.end
end if
on error goto 0
objEmail.From = Request.Form(\"email\")
name = Request.Form(\"name\")
objEmail.AddAddress emailToAddr
objEmail.FromName = name
objEmail.Subject = \"Browser troubleshooting information for \" & name
objEmail.Body = results
objEmail.Host = emailSmtpServer
objEmail.Send
set Mail = Nothing
%>
<blockquote>
<H3>Information sent</H3>
Your submission has been successfully sent. Thank you for reporting this issue. A support representative will get back to you shortly.
</blockquote>
</body></html>
<%
End Function
%>