If you manage to run it before the Twitter scripts, you can change the userAgent directly in the page by using __defineGetter__