Is there a way to extract the script tags using jQuery, which is something the widget loader does as well. I've found that to be more reliable in general.