User Agent Switcher

Since plugin version number 0.2.7 it is no longer necessary to change the user agent! :-)

The Garmin Communicator API JavaScript checks if the script runs on Windows or Mac and refuses to run the plugin if it dectects Linux 8-O *sick* Therefore it is necessary to switch the user agent to “Windows / Firefox”.

The following settings do persuade the java script to use the linux plugin:

Description: Firefox 3.6.6 (Win XP)
User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20100628 Firefox/3.6.6
App Code name: Mozilla
App Name: Firefox
App Version: 3.0
Plattform: Win32
Vendor Sub:

Details about this issue

The javascript provided by Garmin tries to detect the browser and your OS and will refuse to work if the wrong OS is detected.

The file responsible for this is: GarminDeviceControl.js starting from line 1210.

1210 isBrowserSupported: function() {
1211     //console.debug("Display.isBrowserSupported BrowserDetect.OS="+BrowserDetect.OS+", BrowserDetect.browser="+BrowserDetect.browser)
1212     // TODO Extract strings to constants
1213     // TODO Move this out to plugin layer?
1214     return ( (BrowserDetect.OS == "Windows" &&
1215        (BrowserDetect.browser == "Firefox" || BrowserDetect.browser == "Mozilla" || BrowserDetect.browser == "Explorer")
1216        || BrowserDetect.browser == "Safari")
1217        || (BrowserDetect.OS == "Mac" &&
1218        (BrowserDetect.browser == "Firefox" || BrowserDetect.browser == "Safari")) );
1219 }

According to the developer comment in line 1213 even Garmin knows that this is the wrong way!

Feel free to contact Garmin about it!

user_agent_switcher.txt · Last modified: 2017/08/13 18:45 (external edit)     Back to top