In firefox, i made a greasemonkey script that is working pretty well everywhere but twitter's page. Does twitter have some kind of protection against javascript plugins? If so, are there any workaround?
// ==UserScript==
// @name teste.js
// @namespace teste.js
// @version 1
// @grant none
// @include *://www.twitter.com*
// @include *://www.google.com*
// @include *://www.facebook.com*
// @run-at document-start
// ==/UserScript==
var pressedKey = 1;
var scroll;
function KeyCheck(e)
{
var x = e.which || e.keyCode;
console.log(e);
if (x == 97)
{
clearInterval(scroll);
if ( pressedKey == 1 )
{
scroll = setInterval(function(){ window.scrollBy(0,1); }, 50);
pressedKey = -pressedKey;
//document.getElementById("demo").style.backgroundColor = "red";
}
else if (pressedKey == -1)
{
pressedKey = -pressedKey;
//document.getElementById("demo").style.backgroundColor = "blue";
}
}
}
window.addEventListener('keydown', KeyCheck, true);