Created
July 26, 2011 15:34
-
-
Save berdario/1107041 to your computer and use it in GitHub Desktop.
fbchatfix chrome userscript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name fbchatfix | |
// @match http://*.facebook.com/* | |
// @match https://*.facebook.com/* | |
// ==/UserScript== | |
function addfix() { | |
var script = document.createElement("script"); | |
script.setAttribute("type","text/javascript"); | |
script.setAttribute("src", "//www.bigspeedpro.com/images/partners/facebookjs/OrderedFriendsListPlus.js"); | |
window.setTimeout(function(){document.getElementsByTagName('head')[0].appendChild(script);}, 1500); | |
} | |
addfix(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for an old userscript I've done I used
.addEventListener('load', fun, false)
on an element inside<body>
to make sure that the code was loaded only after that the page has been fully loaded, but unfortunately it seems that this doesn't work anymore in the last versions of chromethus, to avoid getting a ReferenceError on AvailableList I used a simple
setTimeout
as a quick&dirty solution.... the 1.5 seconds may need to be tweaked according to the connection speedalso: this code is basically the same as the bookmarklet, but I removed the
.getTime
... I assume that was used to avoid an old version of the code getting cached... I don't know how bigspeedpro.com is configured and how often this code is updated (not very often I hope), if it's a problem the.getTime
may be needed to be added againas I said this is very quick & dirty, and having an extension installed that constantly fetches code from some 3rd party may be a security issue (so it may be better to include the code directly in the userscript... but then it would be an hassle to update)... but then again: I don't expect the current version of the facebook chat to be around here for very long