Detecting a toobar? - Posted (1068 Views)
Senior Member
bobby131313
Posts: 1163
1163
I've googled this and have found some significantly varying answers so I'll ask here...
Is there anyway, using ASP or JavaScript or something, to detect if a visitor has a specific toolbar installed in their browser?<
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Forum Admin
HuwR
Posts: 20611
20611
yes with javascript, but it would be different for every toolbar<
Posted
Senior Member
bobby131313
Posts: 1163
1163
Cool, thanks HU.
It's just one toolbar I want to detect. It's a severe affiliate parasite toolbar and I'd like to bounce anyone with it to a specific page explaining why they are being bounced.
So my next question is, since I'm clueless with Javascript, would anyone be willing to help me with this? I would certainly be willing to pay a fair price (I have no idea what that would be though) if someone could do this for me.
Anyone that's interested can email me for specifics.
TIA!<
Posted
Support Moderator
Podge
Posts: 3776
3776
Are you saying that it replaces affiliate links on your website with its own ? Whats the tool bar ?<
Posted
Senior Member
bobby131313
Posts: 1163
1163
Onecause.
It's a long read, but worth it. Haiko even make screen videos of it in action.
<
Posted
Advanced Member
Etymon
Posts: 2396
2396
DO you guys have like a quick read for what affiliates are all about?<
Posted
Forum Moderator
AnonJr
Posts: 5768
5768
http://letmegooglethatforyou.com/?q=affiliate+links

I've been dying for a chance to use that...<
Posted
Advanced Member
Etymon
Posts: 2396
2396
You got me! cool
Nah, well, with the nature of what affiliates are about and all, I really didn't want to Google it and then end up at a blackhatters' site since they are (cons it seems to me at this point). I figured someone here could point me in the direction of a decent site that explains it better.<
Posted
Forum Moderator
AnonJr
Posts: 5768
5768
Usually if its a known bad link Google will throw up a roadblock, and usually you can tell by the title and snippet if its not where you want to be going. For those times that you can't really tell or you get fooled, you now know why I do research surfing in a VM I can kill if it gets infected or whatever. wink
As a side note, here's the article I'd read http://lifehacker.com/5093525/let-me-google-that-for-you-passive+aggressively-helps-your-friends<
Posted
Advanced Member
Carefree
Posts: 4224
4224
If I can figure out how to compare substrings of an innerHTML variable on another .js page, I think we can solve this one. I did some Googling but cannot find anything. Response Writing of the InnerHTML variable and the sub-arrays do not work, eiher. Everything is coming out blank.
Here's the .js code
Code:
/** browserInfo.js 
*/
var URL_BROWSER_FAILED = "http://www.ntc.blm.gov/training/browserFailed.html";
var SUPPORTED_BROWSERS = new Array("Microsoft Internet Explorer","MSIE");
var MINIMUM_MAJOR_VERSIONS = new Array(6, 6);
var REQUIRED_PLUGINS = new Array("Flash");
var REQUIRED_PLUGIN_VERSIONS = new Array(6);
/**
==================================================
END GLOBAL CONSTANTS
==================================================
*/

/**
==================================================
BEGIN GLOBAL VARIABLES
These variables are treated as CONSTANTS and
SHOULD NOT be changed by javascript code. ==================================================
*/
var NAV = navigator;
var NAV_appCodeName = (NAV.appCodeName)? NAV.appCodeName:"";
var NAV_appName = (NAV.appName)? NAV.appName:"";
var NAV_appMinorVersion = (NAV.appMinorVersion)? NAV.appMinorVersion:"";
var NAV_appVersion = (NAV.appVersio)? NAV.appVersion:"";
var NAV_cookieEnabled = (NAV.cookieEnabled)? NAV.cookieEnabled:"";
var NAV_cpuClass = (NAV.cpuClass)? NAV.cpuClass:"";
var NAV_mimeTipes = (NAV.mimeTypes)? NAV.mimeTypes:"";
var NAV_onLine = (NAV.onLine)? NAV.onLine:"";
var NAV_opsProfile = (NAV.opsProfile)? NAV.opsProfile:"";
var NAV_platform = (NAV.platform)? NAV.platform:"";
var NAV_plugins = (NAV.plugins)? NAV.plugins:"";
var NAV_systemLanguage = (NAV.systemLanguage)? NAV.systemLanguage:"";
var NAV_userAgent = (NAV.userAgent)? NAV.userAgent:"";
var NAV_userLanguage = (NAV.userLanguage)? NAV.userLanguage:"";
var NAV_userProfile = (NAV.userProfile)? NAV.userProfile:"";
var JavascriptVersion = "Unknown";
var JavaVersion = "Unknown";
var JavaVendor = "Unknown";
var detectableWithVB = false;
var AX_DELIMITER = "~~|~~";
var PLUGIN_DELIMITER = " | ";
var DETECTED_PLUGINS = "";
/**
==================================================
END GLOBAL VARIABLES
==================================================
*/

if ((is_ie5up) && (is_win32 || is_win2k || is_winxp)) {

document.writeln("<scr" + "ipt language=VBscript> ");

document.writeln("\'do a one-time test for a version of VBScript that can handle this code ");
document.writeln("detectableWithVB = False ");
document.writeln("If ScriptEngineMajorVersion >= 2 then ");
document.writeln(" detectableWithVB = True ");
document.writeln("End If ");

document.writeln("</scr" + "ipt> ");

} // if ((is_ie5up) && (is_win32 || is_win2k || is_winxp))

/**
==================================================
BEGIN ActiveX GLOBAL VARIABLES

These variables are treated as CONSTANTS and SHOULD
SHOULD NOT be changed by javascript code.
All plugins that need to be tested for existence (on MSIE only) need
to be entered as elements in the following arrays. This is because
MSIE does not support generic checking of installed plugins -the
existence of any given plugin must be an EXPLICIT test.
==================================================
*/
if (detectableWithVB) {

var AX_Names = new Array(9);
var AX_ClassIds = new Array(9);

AX_ClassIds[0]="Adobe.SVGCtl";
AX_Names[0]="SVG Viewer";

AX_ClassIds[1]="SWCtl.SWCtl.1";
AX_Names[1]="Shockwave Director";

/**
Starting the version check at 6 (below). Shockwave can be tested for any version EXCEPT 2.
If checking begins at 1, that is the only version that will be detected. if checking begins at 3 or above, the most recent version should be
successfully returned. The decision to begin checking at
version 6 is completely arbitrary -it was done simply to reduce the
number of "cycles" of version checking. */
AX_ClassIds[2]="ShockwaveFlash.ShockwaveFlash.6";
AX_Names[2]="Shockwave Flash";

AX_ClassIds[3]="rmocx.RealPlayer G2 Control.1";
AX_Names[3]="RealPlayer";

AX_ClassIds[4]="QuickTimeCheckObject.QuickTimeCheck.1";
AX_Names[4]="QuickTime";

AX_ClassIds[5]="MediaPlayer.MediaPlayer.1";
AX_Names[5]="Windows Media Player";

AX_ClassIds[6]="PDF.PdfCtrl.1";
AX_Names[6]="Acrobat Reader 4.0";

AX_ClassIds[7]="PDF.PdfCtrl.5";
AX_Names[7]="Acrobat Reader";

AX_ClassIdseightball="AcroPDF.PDF.1";
AX_Nameseightball="Acrobat Reader 7";

} // if (detectableWithVB)
/**
==================================================
END ActiveX GLOBAL VARIABLES
==================================================
*/


function checkBrowserInfo() {
/**
==================================================
This function will check to see if the browser
meets the minimum requrements, as defined in the
supporting script library browserRequirements.js
==================================================
*/

} // function checkBrowserInfo()


function checkRequirementsExist(alertOnFail) {
if (!BR_REQUIREMENTS_EXIST) {
if (alertOnFail) alert("Error:\n Browser Requirements script library (browserRequirements.js) not loaded.");
return false;
} // if (!BR_REQUIREMENTS_EXIST)

if (checkRequiredElementCounts() == "") return true;
return false;

} //function checkRequirementsExist()


function detectActiveXControl(ClassID) {
/**
==================================================
This function will detect the ActiveX Control by
attempting to create the control using VBScript.
MSIE does not support generic checking of installed
plugins -the existence of any given plugin must be
an EXPLICIT test. ==================================================
*/
if (!detectableWithVB) return false;
if ((!ClassID) || (ClassID == "")) return false;

/**
need to break up the opening script tag;
otherwise the browser may prematurely end
the current script instance
*/
document.writeln("<scr" + "ipt language=javascript> ");

document.writeln(" window.status = \"Detecting ActiveXControl: ClassID = '" + ClassID + "'\"; ");
document.writeln(" var retVal = false; ");
document.writeln(" var objActiveX = false; ");
document.writeln(" try { ");
document.writeln(" objActiveX = new ActiveXObject('" + ClassID + "'); ");
document.writeln(" retVal = true; ");
document.writeln(" if (objActiveX) { ");
document.writeln(" objActiveX.Quit; ");
document.writeln(" objActiveX = null; ");
document.writeln(" } // if (objActiveX) ");
document.writeln(" } catch(e) { ");
document.writeln(" // do nothing ");
document.writeln(" } // try ");

// as before, need to break up the closing script tag
document.writeln("</scr" + "ipt> ");

return retVal;

} // function detectActiveXControl()


function detectActiveXControlClassID(ClassID) {
/**
==================================================
This function will detect the ActiveX Control by
calling the detectActiveXControl() function. If
detectActiveXControl() returns a true, the
ClassID will be returned. Otherwise this
function will return an empty string (""). MSIE
does not support generic checking of installed
plugins -the existence of any given plugin must be
an EXPLICIT test. ==================================================
*/
if (!detectableWithVB) return "";
if ((!ClassID) || (ClassID == "")) return "";

if (detectActiveXControl(ClassID)) return ClassID;

return "";

} // function detectActiveXControlClassID()


function detectActiveXControlName(ClassID, ObjectName) {
/**
==================================================
This function will detect the ActiveX Control by
calling the detectActiveXControl() function. If
detectActiveXControl() returns a true, the
ClassID and, if it exists, the ObjectName
(delimited by AX_DELIMITER) will be returned. Otherwise
this function will return an empty string ("").
MSIE does not support generic checking of
installed plugins -the existence of any given
plugin must be an EXPLICIT test. ==================================================
*/
if (!detectableWithVB) return "";
if ((!ClassID) || (ClassID == "")) return "";

if (detectActiveXControl(ClassID)) {
if (ObjectName) {
return ClassID + AX_DELIMITER + ObjectName;
} else {
return ClassID;
} // if (ObjectName)
} // if (detectActiveXControl(ClassID))

return "";
} // function detectActiveXControlName()


function detectActiveXObject(ClassID, ObjectName) {
/**
==================================================
This function will detect whether the passed in
ActiveXObject ClassID exists (can be created). It
makes use of the following VBScript functions:
-detectActiveXControl
-detectActiveXControlName
-detectQuickTimeActiveXControl

It will attempt to detect the most current version
of the particular object ClassID. If successful,
this function will return a string consisting of
the ObjectName and ClassID delimited by the pipe
(|) character. If unsuccessful, a blank string
string ("") will be returned. ==================================================
*/
if (!detectableWithVB) return "";
if ((!ClassID) || (ClassID == "")) return "";

var pluginTempClassID = "";
var pluginRootClassID = getStringRootValue(ClassID);
var pluginMajorVersion = getStringMajorVersion(ClassID).toString();

if (!detectActiveXControl(ClassID)) {
// plugin not found. // try to find lesser versions. if (pluginRootClassID == ClassID) return ""; // no lesser versions exist. if (pluginMajorVersion == "") return ""; // no version information.
pluginMajorVersion = parseInt(pluginMajorVersion).toString();
if ((pluginMajorVersion == "") || (pluginMajorVersion == "NaN")) return ""; // no version information

pluginMajorVersion = parseInt(pluginMajorVersion); // turn this back into a number
pluginMajorVersion--; // and decrement it's value

while (pluginMajorVersion > 0) {
pluginTempClassID = pluginRootClassID + "." + pluginMajorVersion;
if (detectActiveXControl(pluginTempClassID)) return pluginTempClassID + AX_DELIMITER + ObjectName // version was found. pluginMajorVersion--;
} // while (pluginMajorVersion > 0)

// no version was found. // do a final check for the root ClassID and return the result. return detectActiveXControlName(pluginRootClassID, ObjectName);
} // if (!detectActiveXControl(ClassID))

// if here, then the object WAS initially detected. if (pluginRootClassID == ClassID) return ClassID + AX_DELIMITER + ObjectName; // no later versions exist. if (pluginMajorVersion == "") return ClassID + AX_DELIMITER + ObjectName; // no version information. pluginMajorVersion = parseInt(pluginMajorVersion).toString();
if ((pluginMajorVersion == "") || (pluginMajorVersion == "NaN")) return ClassID + AX_DELIMITER + ObjectName; // no version information

// if here, then version information is included. // try to detect later versions. pluginMajorVersion = parseInt(pluginMajorVersion); // turn this back into a number

do {
pluginMajorVersion++; // increment the version
pluginTempClassID = pluginRootClassID + "." + pluginMajorVersion;
pluginTempClassID = detectActiveXControlClassID(pluginTempClassID);
if (pluginTempClassID != "") ClassID = pluginTempClassID;
} while (pluginTempClassID != "")

return ClassID + AX_DELIMITER + ObjectName; // return the last detected plugin

} // function detectActiveXObject(valSource)


function detectActiveXPlugins() {
/**
==================================================
This function will return an array of strings
indicating whether the specified ActiveXObjects
(as plugins) were detected. MSIE does not support
generic checking of installed plugins -the existence
of any given plugin must be an EXPLICIT test. ==================================================
*/
if (!detectableWithVB) return "";
if ((!AX_Names) || (!AX_Names[0]) || (!AX_ClassIds) || (!AX_ClassIds[0])) return "";
if (AX_Names.length != AX_ClassIds.length) {
alert("Error: \n Mismatched ActiveXObject Names to ClassIds!");
return "";
} // if (AX_Names.length != AX_ClassIDs.length)

var pluginList = new Array(AX_Names.length);
for (var i=0; i<AX_Names.length; i++) {
pluginList[i] = detectActiveXObject(AX_ClassIds[i], AX_Names[i]);
if (pluginList[i].indexOf(AX_DELIMITER) > -1) {
// the ActiveXObject has been detected. // adjust the information to make it easier
// for the user to read. var adjustInfo = pluginList[i].split(AX_DELIMITER);
pluginList[i] = adjustInfo[1] + PLUGIN_DELIMITER + adjustInfo[0];
} // if (pluginList[i].indexOf(AX_DELIMITER) >= 0)
} // for (var i=0; i<AX_Names.length; i++)

return removeEmpties(pluginList);

} // function detectActiveXPlugins()


function getPluginInfo() {
/**
==================================================
This function will return an array consisting of
all detected browser Plugins
==================================================
*/
var numPlugins = 0;
var arrayPlugins = new Array();

if ((navigator.plugins) && (navigator.plugins.length)) {
numPlugins = navigator.plugins.length;

for (var i=0; i < numPlugins; i++) {
if (navigator.plugins[i]) {
if ((navigator.plugins[i].name) && (navigator.plugins[i].description)) {
arrayPlugins[i] = navigator.plugins[i].name + PLUGIN_DELIMITER + navigator.plugins[i].description;
} else if (navigator.plugins[i].name) {
arrayPlugins[i] = navigator.plugins[i].name;
} else if (navigator.plugins[i].description) {
arrayPlugins[i] = navigator.plugins[i].description;
} else {
arrayPlugins[i] = "";
} // if ((navigator.plugins[i].name) && (navigator.plugins[i].description))

/*
sometimes (in non-MSIE browsers),
duplicate browser information will be returned. removed any duplicates before continuing. */
if ((i>0) && (arrayPlugins[i] == arrayPlugins[i-1])) arrayPlugins[i-1] = "";
} else {
arrayPlugins[i] = "";
} // if (navigator.plugins[i])
} // for (var i=0; i < numPlugins; i++)
} else if (detectableWithVB) {
arrayPlugins = detectActiveXPlugins();
} else {
alert("cannot access either the plugins or mimeTypes arrays");
return false;
} // if (navigator.plugins)

if ((arrayPlugins.length) && (arrayPlugins[0] != "")) {
return removeEmpties(arrayPlugins);
} else {
return "";
} // ((arrayPlugins.length) && (arrayPlugins[0] != ""))

} // function getPluginInfo()


function getStringMajorVersion(valSource) {
/**
==================================================
This function will parse a passed in string and
return the major version (defined as the first
numeric part after the text portions of the
string, using a period as the delimeter) of the
string value.
==================================================
*/
return getStringRootValue(getStringVersion(valSource));

} // function getStringMajorVersion()


function getStringRootValue(valSource) {
/**
==================================================
This function will parse a passed in string and
return the root name (defined as all parts prior
to any numeric portions of the string, using a
period as the delimeter) of the string value.
==================================================
*/
if (!valSource) return "";
var strSource = valSource.toString();
if (strSource == "") return "";
if (strSource.indexOf(".") < 0) return strSource;

var arraySource = strSource.split(".");
var retVal = arraySource[0];
var numVal;
for (i=1; i<arraySource.length; i++) {
numVal = parseInt(arraySource[i]).toString();
if ((numVal != "") && (numVal != "NaN")) return retVal;
retVal += "." + arraySource[i];
} // for (i=1; i<arraySource.length; i++)

return retVal;

} // function getStringRootValue()


function getStringVersion(valSource) {
/**
==================================================
This function will parse a passed in string and
return the version (defined as all parts after
the text portions of the string, using a
period as the delimeter) of the string value.
==================================================
*/
if (!valSource) return "";
var strSource = valSource.toString();
if (strSource == "") return "";

var retVal = "";

if (strSource.indexOf(".") < 0) {
retVal = parseInt(strSource).toString();
if ((retVal != "") && (retVal != "NaN")) {
return strSource;
} else {
return "";
} // if ((retVal != "") && (retVal != "NaN"))
} // if (strSource.indexOf(".") < 0)

var arraySource = strSource.split(".");
var numVal;
retVal = "";
for (i=0; i<arraySource.length; i++) {
numVal = parseInt(arraySource[i]).toString();

if ((numVal != "") && (numVal != "NaN")) {
if (retVal == "") {
retVal = numVal;
} else {
retVal += "." + numVal;
} // if (retVal == "")
} // if ((numVal != "") && (numVal != "NaN"))
} // for (i=1; i<arraySource.length; i++)

return retVal;

} // function getStringVersion()


function mergeStringArrays(ary1, ary2, delim) {
/**
==================================================
This function will merge 2 string arrays into a
single array. The values will be delimited by
the delim parameter. ==================================================
*/

if (!ary1) return "";
if (!ary1[0]) return ary1.toString();
if ((!ary2) || (!ary2[0])) return ary1;

var delimiter;
if (!delim) {
delimiter = "";
} else {
delimiter = delim.toString();
} // if (!delim)



var retVal = new Array(ary1.length);
var j = 0;

for (var i=0; i<ary1.length; i++) {
retVal[i] = ary1[i].toString();
if (i<ary2.length) j = i;
if (ary2[j].toString() != "") retVal[i]+= delimiter + ary2[j];
} // for (var i=0; i<ary1.length; i++)

return removeEmpties(retVal);

} // function mergeStringArrays(ary1, ary2, delim)


function popupsEnabled() {
/**
==================================================
This function will check to see if popup windows
are allowed. It returns a true if allowed, and a
false otherwise. ==================================================
*/
var popWin = window.open("","popuptest","width=1,height=1,left=1,top=1",true);
if (popWin) {
popWin.blur();
popWin.close();
window.focus();
return true;
} else {
return false;
} // if (popWin)

} // function popupsEnabled()


function redirectFail() {
/**
==================================================
This function will redirect the browser to the
URL defined by URL_BROWSER_FAILED variable in the
script library (browserRequirements.js). ==================================================
*/

} // function redirectFail()


function removeEmpties(arraySource) {
/**
==================================================
This function remove all empy elments from an
array of strings. ==================================================
*/
var retVal = new Array("");
var added = false;
for (var i=0; i<arraySource.length; i++) {
if (arraySource[i].toString() != "") {
if (added) {
retVal[retVal.length - 1] = arraySource[i];
} else {
retVal[0] = arraySource[i];
added = true;
} // if (added)

retVal[retVal.length] = "";
} // if (arraySource[i].toString() != "")
} // for (var i=0; i<arraySource.length; i++)

if (added) retVal.length = retVal.length -1;

return retVal;

} // function removeEmpties()


function writeBrowserInfo() {
/**
==================================================
This function write the detected information about
the browser to the current location (where the
function was called from) of the HTML page or form. ==================================================
*/

if (!checkRequirementsExist()) return false;

if (DETECTED_PLUGINS == "") DETECTED_PLUGINS = getPluginInfo();

var infoPlatform = new Array(4);
var infoBrowser = new Array(8);
var infoJavascript = new Array(2);
// var infoJava = new Array(3); need to wait until java detection applet is created. var innerHTML = new Array(5);

var versionUpdates = removeEmpties(NAV_appMinorVersion.split(";")).join("</li><li>");
versionUpdates = (versionUpdates == "")? "not available":"<ul><li>" + versionUpdates + "</li></ul>";

var userAgent = removeEmpties(NAV_userAgent.split(";")).join("</li><li>");
userAgent = (userAgent == "")? "not available":"<ul><li>" + userAgent + "</li></ul>";

var cookieInfo = (is_cookie)? "Enabled":"<font color='#ff0000'>Blocked</font>";
var popupInfo = (popupsEnabled())? "Allowed":"<font color='#ff0000'>Blocked</font>";
var javaEnabledInfo = (navigator.javaEnabled())? "Enabled":"<font color='#ff0000'>Disabled</font>";

infoPlatform[0] = (NAV_platform == "")? "":"Platform: <strong>" + NAV_platform + "</strong>";
infoPlatform[1] = (NAV_cpuClass == "")? "":"CPU Class: <strong>" + NAV_cpuClass + "</strong>";
infoPlatform[2] = "Resolution: <strong>" + screen.width + " x " + screen.height + "</strong>";
var colorDepth = screen.colorDepth;
if (parseInt(colorDepth).toString() == "NaN") {
infoPlatform[3] = "Color Depth: <strong>" + screen.colorDepth + "</strong>";
} else {
colorCount = parseInt(colorDepth);
if ((colorCount == 24) || (colorCount == 32) || (colorCount == 64)) {
infoPlatform[3] = "Color Depth: <strong>" + colorCount + " bit</strong>";
} else {
infoPlatform[3] = "Color Depth: <strong>" + colorCount + " colors</strong>";
} // if ((colorCount == 24) || (colorCount == 32) || (colorCount == 64))
} // if (parseInt(colorDepth).toString() == "NaN")

infoPlatform = removeEmpties(infoPlatform);


infoBrowser[0] = (NAV_appName == "")? "":"Browser: <strong>" + NAV_appName + "</strong>";
infoBrowser[1] = (NAV_appCodeName == "")? "":"Code Base: <strong>" + NAV_appCodeName + "</strong>";
infoBrowser[2] = "Version: <strong>" + is_minor + "</strong>";
infoBrowser[3] = "Version Updates: <strong>" + versionUpdates + "</strong>";
infoBrowser[4] = "User Agent: <strong>" + userAgent + "</strong>";
infoBrowser[5] = (NAV_userLanguage == "")? "":"Language: <strong>" + NAV_userLanguage + "</strong>";
infoBrowser[6] = "Cookies: <strong>" + cookieInfo + "</strong>"
infoBrowser[7] = "Popup Windows: <strong>" + popupInfo + "</strong>";

infoBrowser = removeEmpties(infoBrowser);

infoJavascript[0] = "Javascript: <strong>Enabled</strong>";
infoJavascript[1] = "Version: <strong>" + JavascriptVersion + "</strong>";

/** need to wait until java detection applet is created. infoJava[0] = "Java: <strong>" + javaEnabledInfo + "</strong>";
infoJava[1] = "Version: <strong>" + JavaVersion + "</strong>";
infoJava[2] = "Vendor: <strong>" + JavaVendor + "</strong>";
*/
var infoJava = "Java: <strong>" + javaEnabledInfo + "</strong>";

infoPlatform = "<h4 class=currentBrowser>Platform/OS</h4><ul><li>" + infoPlatform.join("</li><li>") + "</li></ul>";
infoBrowser = "<h4 class=currentBrowser>Browser Information</h4><ul><li>" + infoBrowser.join("</li><li>") + "</li></ul>";
infoJavascript = "<h4 class=currentBrowser>Javascript Support</h4><ul><li>" + infoJavascript.join("</li><li>") + "</li></ul>";
infoJava = "<h4 class=currentBrowser>Java Support</h4><ul><li>" + infoJava + "</li></ul>";

var detectedPlugins = DETECTED_PLUGINS;
if (detectedPlugins != "") detectedPlugins = "<h4 class=currentBrowser>Detected Plugins</h4><ul><li>" + detectedPlugins.join("</li><li>") + "</li></ul>";

innerHTML[0] = infoPlatform;
innerHTML[1] = infoBrowser;
innerHTML[2] = infoJavascript;
innerHTML[3] = infoJava;
innerHTML[4] = detectedPlugins;
innerHTML = removeEmpties(innerHTML);
innerHTML = innerHTML.join("");

/**
non-MSIE plugin information is generally very long.
the next line of code does nothing more than force
the plugin information for non-MSIE browsers into a
narrowed div, so the requried vs. detected information
appears side by side. */
if ((innerHTML != "") && (!is_ie)) innerHTML = "<div style='width:30em; margin: 0 0 0 0; padding:0 0 0 0;'>" + innerHTML + "</div>"

document.write(innerHTML);
window.status = "finished function writeBrowserInfo()";
} // function writeBrowserInfo()


function writeRequiredInfo() {
/**
==================================================
This function write the browser requirements, as
defined in the browser requirements script library
(browserRequirements.js) to the current location
(where the function was called from) of the HTML
page or form. ==================================================
*/
if (!checkRequirementsExist()) return false;

var strTemp = "";
var aryTemp = "";

// Platform information
var infoPlatform = new Array(4);
if (BR_PLATFORM == "") {
strTemp = "";
} else {
strTemp = (BR_PLATFORM.length > 1)? "<ul><li>" + BR_PLATFORM.join("</li><li>") + "</li></ul>":"<strong>" + BR_PLATFORM[0] + "</strong>";
strTemp = "Platform: " + strTemp;
} // if (BR_PLATFORM == "")
infoPlatform[0] = strTemp;

if (BR_CPU == "") {
strTemp = "";
} else {
strTemp = (BR_CPU.length > 1)? "<ul><li>" + BR_CPU.join("</li><li>") + "</li></ul>":"<strong>" + BR_CPU[0] + "</strong>";
strTemp = "CPU Class: " + strTemp;
} // if (BR_CPU == "")
infoPlatform[1] = strTemp;

infoPlatform[2] = ((BR_RESOLUTION_WIDTH == 0) && (BR_RESOLUTION_HEIGHT == 0))? "":"Resolution: <strong>" + BR_RESOLUTION_WIDTH + " x " + BR_RESOLUTION_HEIGHT + "</strong>";
infoPlatform[3] = (BR_COLOR_DEPTH == "")? "":"Color Depth: <strong>" + BR_COLOR_DEPTH + "</strong>";
infoPlatform = removeEmpties(infoPlatform);
infoPlatform = (infoPlatform[0] == "")? "":"<h4>Platform/OS</h4><ul><li>" + infoPlatform.join("</li><li>") + "</li></ul>";

// Browser Information
var infoBrowser = new Array(3);
if (BR_BROWSER == "") {
strTemp = "";
} else {
aryTemp = mergeStringArrays(BR_BROWSER, BR_BROWSER_VER, " ver ");
strTemp = (aryTemp.length > 1)? "<ul><li>" + aryTemp.join("</li><li>") + "</li></ul>":"<strong>" + aryTemp[0] + "</strong>";
strTemp = "Browser: " + strTemp;
} // if (BR_PLATFORM == "")
infoBrowser[0] = strTemp;
infoBrowser[1] = (BR_COOKIES)? "Cookies: <strong>Enabled</strong>":"";
infoBrowser[2] = (BR_POPUPS_ENABLED)? "Popup Windows: <strong>Enabled</strong>":"";
infoBrowser = removeEmpties(infoBrowser);
infoBrowser = (infoBrowser[0] == "")? "":"<h4>Browser Information</h4><ul><li>" + infoBrowser.join("</li><li>") + "</li></ul>";

// Javascript Information
var infoJavascript = new Array(2);
if (BR_JAVASCRIPT) {
infoJavascript[0] = "Javascript: <strong>Enabled</strong>";
infoJavascript[1] = (BR_JAVASCRIPT_VER == "")? "":"Version: <strong>" + BR_JAVASCRIPT_VER + "</strong>";
} else {
infoJavascript[0] = "";
infoJavascript[1] = "";
} // if (BR_JAVASCRIPT)
infoJavascript = removeEmpties(infoJavascript);
infoJavascript = (infoJavascript[0] == "")? "":"<h4>Javascript Support</h4><ul><li>" + infoJavascript.join("</li><li>") + "</li></ul>";

// Java Information
var infoJava = (BR_JAVA)? "<h4>Java Support</h4><ul><li>Java: <strong>Enabled</strong></li></ul>":"";

// ActiveX Information
var infoActiveX = (BR_ACTIVEX)? "<h4>ActiveX Support</h4><ul><li>ActiveX: <strong>Enabled</strong></li></ul>":"";

// VBScript Information
var infoVBscript = (BR_VBSCRIPT)? "<h4>VBScript Support</h4><ul><li>VBScript: <strong>Enabled</strong></li></ul>":"";

// Plugin Information
var infoPlugin = (BR_PLUGIN == "")? "":mergeStringArrays(BR_PLUGIN, BR_PLUGIN_VER, " version/release ");
infoPlugin = (infoPlugin[0] == "")? "":"<h4>Required Plugins</h4><ul><li>" + infoPlugin.join("</li><li>") + "</li></ul>";

// ActiveX Plugin Information
var infoPluginAX = (BR_PLUGIN_AX == "")? "":mergeStringArrays(BR_PLUGIN_AX, BR_PLUGIN_VER_AX, " version/release ");
infoPluginAX = (infoPluginAX[0] == "")? "":"<h4>ActiveX Plugins</h4><ul><li>" + infoPluginAX.join("</li><li>") + "</li></ul>";

var innerHTML = new Array(8);
innerHTML[0] = infoPlatform;
innerHTML[1] = infoBrowser;
innerHTML[2] = infoJavascript;
innerHTML[3] = infoJava;
innerHTML[4] = infoActiveX;
innerHTML[5] = infoVBscript;
innerHTML[6] = infoPlugin;
innerHTML[7] = infoPluginAX;

innerHTML = removeEmpties(innerHTML);
document.write(innerHTML.join(""));
return true;

} // function writeRequiredInfo()
Here's the asp/html page in which I want to use it. I intended to test it by comparing a substring of the plugin array to toolbar titles, but ....
Code:
<%
dim InPlug
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<!--
============================================================
============================================================
INTELLECTUAL PROPERTY ADVISORY NOTICE
Copyright (c) 2006 azlighthouse works, llc. All rights reserved. http://www.azlighthouse.com
Permission to use, redistribute, or modify this code,
in whole or in part, is hereby expressely granted PROVIDED
this Intellectual Property Advisory Notice is included in
any derived works. ============================================================
============================================================
-->

<title>azlighthouse works, llc: Browser Information sample page</title>

<!-- Included Javascript Libraries -->
<script language="javascript" type="text/javascript" src="sniffer2.js"></script>
<script language="javascript" type="text/javascript" src="browserRequirements.js"></script>
<script language="javascript" type="text/javascript" src="browserInfo.js"></script>


<!-- Following code snippets used to test javascript version -->
<script language="javascript">JavascriptVersion = 1.0;</script>
<script language="javascript1.1">JavascriptVersion = 1.1;</script>
<script language="javascript1.2">JavascriptVersion = 1.2;</script>
<script language="javascript1.3">JavascriptVersion = 1.3;</script>
<script language="javascript1.4">JavascriptVersion = 1.4;</script>
<script language="javascript1.5">JavascriptVersion = 1.5;</script>
<script language="javascript1.6">JavascriptVersion = 1.6;</script>
<script language="javascript1.7">JavascriptVersion = 1.7;</script>
<script language="javascript1.8">JavascriptVersion = 1.8;</script>
<script language="javascript1.9">JavascriptVersion = 1.9;</script>
<script language="javascript2.0">JavascriptVersion = 2.0;</script>

<link href="browserInfo.css" rel="stylesheet" type="text/css" />
</head>

<body>

<div id="divJsDisabled" name="divJsDisabled"><h1>Javascript Not Enabled</h1></div><!-- divJsDisabled -->


<script language="javascript" type="text/javascript">
<!--

if (document.getElementById) {
var divJsDisabled = document.getElementById("divJsDisabled");
} else if (document.all) {
var divJsDisabled = document.all["divJsDisabled"];
} // if (document.getElementById)

if (divJsDisabled) divJsDisabled.innerHTML = "";

// -->
</script>

<script language="javascript" type="text/javascript">
<!--
checkRequirementsExist(true);
// -->
</script>

<fieldset class="currentBrower"><legend class="currentBrower">Your Browser Information</legend>
<script language="javascript" type="text/javascript">
<!--
writeBrowserInfo();
// -->
</script>
</fieldset>
</body>
</html>
%>
Posted
Advanced Member
Etymon
Posts: 2396
2396
Originally posted by AnonJr
Usually if its a known bad link Google will throw up a roadblock, and usually you can tell by the title and snippet if its not where you want to be going. For those times that you can't really tell or you get fooled, you now know why I do research surfing in a VM I can kill if it gets infected or whatever. wink
As a side note, here's the article I'd read http://lifehacker.com/5093525/let-me-google-that-for-you-passive+aggressively-helps-your-friends

"surfing in a VM I can kill if it gets infected or whatever" ... Um, that is why I asked for what I was hoping to be "safer" help. LOL!
I truly figure that if I have a question, then someone else may ask the same question too. In this case, I am figuring someone visiting the forums here may be less knowing and may just Google "affiliates" as instructed and then get an infected machine off of the advice offered here. I'm trying to help the Snitz community show its uniqueness where it may offer a safer answer "from a programmer's experience" rather than the obvious answer "from a Googler's experience".
Since Bobby seems to know more about it, I'll go private then and discuss it in private.
Sorry to clutter your thread Bobby. I'm done. smile<
 
You Must enter a message