i don't think 'location.hostname' means anything to the macro plugin - remember, it's not a javascript engine - so probably any js you actually want to execute would have to appear in the form of something like:
open(javascript:<stuff goes here>);
but i haven't done much of that, since i don't usually have js turned on.