The Node body has not been created when chrome executes the code. So you can change your code like this:
window.onload=function(){
function Do(){alert("test");};
new MutationObserver(Do).observe(document.body,{childList:true,subtree:true});
};
or do with jQuery:
$(document).ready(function(){
//your code
});