L
laredotornado
Hi,
Is it possible to fool Javascript running on a Mac Safari web
browser into believing it is a PC IE browser? We have the following JS
code that is detecting both Mac and Safari. Sadly, we do not have
control over the code.
// Global variables for platform branching
var NN, IE, MAC, browserVersion
// Flag to ensure that projectData document is loaded
var framesLoaded = false;
// Browser test
if (parseInt(navigator.appVersion) >= 4)
{
if (navigator.appName == "Netscape")
NN = true
else
IE = true
}
else
{
// browser is to old
alert("This page will not function properly in this browser because it
requires a browser version of 4.0 or above.");
}
// Version
if (IE) {
browserVersion =
navigator.appVersion.charAt(navigator.appVersion.indexOf("MSIE") + 5);
}
else if (NN) {
browserVersion = parseInt(navigator.appVersion);
}
// Computer test
if (navigator.appVersion.indexOf("Mac") != -1) {
MAC = true;
}
if (NN && MAC) {
alert("This activity cannot be used on a Macintosh running a Netscape
Web browser.");
back();
}
Thanks, - Dave
Is it possible to fool Javascript running on a Mac Safari web
browser into believing it is a PC IE browser? We have the following JS
code that is detecting both Mac and Safari. Sadly, we do not have
control over the code.
// Global variables for platform branching
var NN, IE, MAC, browserVersion
// Flag to ensure that projectData document is loaded
var framesLoaded = false;
// Browser test
if (parseInt(navigator.appVersion) >= 4)
{
if (navigator.appName == "Netscape")
NN = true
else
IE = true
}
else
{
// browser is to old
alert("This page will not function properly in this browser because it
requires a browser version of 4.0 or above.");
}
// Version
if (IE) {
browserVersion =
navigator.appVersion.charAt(navigator.appVersion.indexOf("MSIE") + 5);
}
else if (NN) {
browserVersion = parseInt(navigator.appVersion);
}
// Computer test
if (navigator.appVersion.indexOf("Mac") != -1) {
MAC = true;
}
if (NN && MAC) {
alert("This activity cannot be used on a Macintosh running a Netscape
Web browser.");
back();
}
Thanks, - Dave