Simple snippet that can be added into the background page code to modify the user agent for analytics etc. if executed at the proper time. Also has a bookmarklet executor included.