Skip to content

Instantly share code, notes, and snippets.

@hallvors
Created October 6, 2013 17:12
Show Gist options
  • Save hallvors/6856535 to your computer and use it in GitHub Desktop.
Save hallvors/6856535 to your computer and use it in GitHub Desktop.
Faking navigator properties for the JS environment (note: must be injected before page JS runs!)
(function(props){
for(var name in props)
navigator.__defineGetter__(name, (function(name){return function(){return props[name]}})(name));
})({
userAgent: 'Mozilla/5.0 (Mobile; rv:18.1) Gecko/18.1 Firefox/18.1',
appCodeName: 'Mozilla',
appName: 'Netscape',
appVersion: '5.0',
vendor:'',
vendorSub:''
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment