I’m trying to get the following bookmark to act as a Greasemonkey script to work around an accessibility bug with the stackexchange sites.
javascript:(function(){$('a,%20.vote-up-off,%20.vote-down-off,%20.star-off').attr({role:'link',tabindex:'0'});})()
When I remove the function() and put it in the following Greasemonkey script it does not work.
// ==UserScript==
// @name StackExchange access
// @description Enables y-aria stuff on stackoverflow
// @include *
// ==/UserScript==
$('a,%20.vote-up-off,%20.vote-down-off,%20.star-off').attr({role:'link',tabindex:'0'});
alert("worldzz");
I’m guessing that I need to access the document object somehow from Greasemonkey but am not sure how to do this.
I know the script is getting called because if I comment out the $('a,%20.vote-up-off,%20.vote-down-off,%20.star-off').attr({role:'link',tabindex:'0'}) line my alert gets hit.
window.wrappedJSObject%20in your Greasemonkey version with a space charCode: