One More Update to the Door Sign Javascript

One more set of bug fixes for this original post.

Sometime early this week, Twitter broke some redirection I had been relying on. That is, if I was on my phone, URLs on automatically redirected to and kept all my parameters for status and such. had no problem handling the request if I went there explicitly, though.

So here’s the code that lets the phone automatically run to the mobile site, and keeps the PC on the regular site. Yes, it’s browser detection and not feature detection, but I’m the only user, and anyone else wanting to do this kind of thing will probably be similarly relaxed on requirements.

<script type="text/javascript">
 // Detects if the current browser is a Palm Pre/Pixi of some sort. Adapted from
 // Initialize our user agent string to lower case.
 var devicewebos = "webos";
 var uagent = navigator.userAgent.toLowerCase();
 function DetectWebOS() {    
 if ( > -1)
 return true;    else
 return false;

 function gotostatuspage(message) {
 // Navigate to the status page, append a pseudo-random number to
 // trick Twitter into letting us post the same status message
 // repeatedly. The feed filter will edit out the added number.
 var d = new Date();
 var ms = d.getMilliseconds();
 if (DetectWebOS()) {
 // Twitter didn't like getting redirects from the regular site
 // to the mobile one, it seems.
 var urlvar = ""+message+" {"+ms+"}";

 } else {
 var urlvar = ""+message+" {"+ms+"}";
 // Refs:

Leave a comment

Your email address will not be published. Required fields are marked *