Avoid unnecessary JS errors by preventing any attempts to link the
extension to the page via document.body when (in rare cases)
document.body is null.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
console.debug('Loading Hatch relay content script');
-// Tell the page DOM we're here.
-document.body.setAttribute('hatch-is-open', '4-8-15-16-23-42');
+// document.body can be null in rare cases, e.g. quick page reload.
+if (document.body) {
+
+ // Tell the page DOM we're here.
+ document.body.setAttribute('hatch-is-open', '4-8-15-16-23-42');
+}
/**
* Open a port to our extension.