Latest version of Chrome complains that the user experience is
impaired by sync xmlhttpreqs on the main thread.
This patch changes the AJAX call to an async model, delivering
a better user experience.
Signed-off-by: ddalex <firstname.lastname@example.org>
If the HTML response returns without a head
(e.g. because a permanent redirect)
then soup.head will be None and the page will crash.
We append the script tag only of soup finds a page head.
Signed-off-by: Alex D <email@example.com>