get/replace the external dependencies of an HTML document