I am trying to browse a website, however, it only works under Windows and Mac because they use the navigator.platform
from JavaScript to find out the architecture I am running on. Of course, they also use the browser's user agent, but that was easy to spoof.
Here is the .js in question: http://pastebin.com/f56fd608d. The code responsible for browser detection is at the top. Is there any way of changing the .js file before the site runs, or something similar, so I can eliminate the check?
Using the JavaScript console yields:
>navigator.platform
Linux i686
Evidently I changed the browser's user agent, but navigator.platform
does not seem to take it's value from the user agent.
Maybe someone knows how to change the value returned by navigator.platform
, because I hate running Windows under VirtualBox to use this site.
EDIT: This could be of interest because Linux users might be artificially denied access to websites, and can do nothing about it.
JavaScript has a standard object called navigator that contains data about the browser being used. The navigator object has a lot of properties, but the . userAgent property — a string that contains data about the browser, operating system, and more– is all we'll need.
The navigator object contains information about the browser. The location object is a property of the window object.
The JavaScript navigator object is used for browser detection. It can be used to get browser information such as appName, appCodeName, userAgent etc. The navigator object is the window property, so it can be accessed by: window. navigator.
Answer: To establish the actual name of the user's Web browser, you can use the navigator. appName and navigator. userAgent properties. The userAgent property is more reliable than appName because, for example, Firefox or Opera may return the string "Netscape" as the value of navigator.
var fakePlatformGetter = function () { return "your fake platform"; }; if (Object.defineProperty) { Object.defineProperty(navigator, "platform", { get: fakePlatformGetter }); Object.defineProperty(Navigator.prototype, "platform", { get: fakePlatformGetter }); } else if (Object.prototype.__defineGetter__) { navigator.__defineGetter__("platform", fakePlatformGetter); Navigator.prototype.__defineGetter__("platform", fakePlatformGetter); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With