I have this problem with a script not executing on mobile twitter. I have tried it on many versions of Firefox including FF5, FF8, and FF9.
I have used the latest versions of Greasemonkey. Right now I have FF9 with GM 0.9.10. I do not have any problems executing the script on the normal twitter but on mobile it does not work. Maybe has something to do with HTTPS?
Here is the script:
// ==UserScript==
// @name Twitter Mobile
// @namespace http://www.test.com
// @include https://mobile.twitter.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
// ==/UserScript==
function MainLoop() {
if(typeof unsafeWindow.jQuery == 'undefined') {
window.setTimeout(MainLoop, 100);
return;
}
var $ = unsafeWindow.jQuery;
$(document).ready(function(){
//do something here
});
window.setTimeout(MainLoop, 2000);
}
MainLoop();
I have tried everything possible. Also, checked the @require alternatives and tried them. I do not know why it refuses to execute.
All that
MainLoopstuff is not required, and also forcing the wrong instance of jQuery.Please do the following:
Switch back to the latest stable version of Firefox (Currently version 6).
Delete everything after
// ==/UserScript==in the script except the//do something herepart.unsafeWindow.jQuery.$(document).readycalls; Greasemonkey executes at the proper time by default.setTimeout()calls; they are counter productive.Change the
@requiredirective to:Paste or link to the complete script! The current script is probably failing mostly because it’s checking for something on the page that is AJAXed-in.
get around that with code like this:
In fact, this script works perfectly well:
If you are logged into twitter mobile, it will preload a tweet in the message box (but not send).