Created
September 23, 2016 06:59
-
-
Save sampotts/acbfd3dcfcbfc252dacb6768ffe46a0c to your computer and use it in GitHub Desktop.
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
;(function() { | |
if (!('MutationObserver' in window)) { | |
return; | |
} | |
var observer = new MutationObserver(function(mutations) { | |
console.log('mutation: ' + mutations.length); | |
for(var m = 0; m < mutations.length; ++m) { | |
for(var n = 0; n < mutations[m].addedNodes.length; ++n) { | |
findEmbed(mutations[m].addedNodes[n]); | |
} | |
} | |
}); | |
function findEmbed(node){ | |
var $embed = $(node).find('[data-selz-b]'); | |
if($embed.length > 0){ | |
eval($embed.text()); | |
window._$elz = _$elz; | |
} | |
} | |
observer.observe(document.getElementById("content"), { | |
childList: true | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment