Skip to content

Instantly share code, notes, and snippets.

@spiralx
Created August 27, 2014 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spiralx/8cd84dfe8dd8987ec737 to your computer and use it in GitHub Desktop.
Save spiralx/8cd84dfe8dd8987ec737 to your computer and use it in GitHub Desktop.
Silly user script
// ==UserScript==
// @id facebook-so-what@spiralx.org
// @name Facebook So Hwæt
// @version 0.0.1
// @namespace http://spiralx.org/facebook-what
// @author James Skinner <spiralx@gmail.com> http://github.com/spiralx
// @match https://*.facebook.com/*
// @match https://facebook.com/*
// @exclude */ai.php*
// @run-at document-end
// @priority -1
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
// @require https://gist.githubusercontent.com/spiralx/9d22363e742be60ba28b/raw/c5eaea18df02811b104d859056eccff91af90dd5/mutation-summary.js
// ==/UserScript==
; (function($, document, window, undefined) {
var observer = new MutationSummary({
callback: function(summaries) {
summaries[0].added.src.forEach(function(elem) {
var $el = $(elem),
t = $el.text();
if (/^So\b/.test(t)) {
$el.children().text(t.replace(/^So\b/, 'Hwæt'));
}
});
},
rootNode: $('#contentArea')[0],
queries: [
{ element: 'div.userContent' }
]
});
})(jQuery, document, window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment