Check if document body exists

This commit is contained in:
Artur Shaikhullin 2017-12-28 23:04:04 +06:00
parent 83f8d84012
commit 7d181ee4b5

View File

@ -965,7 +965,8 @@ window._qutebrowser.caret = (function() { // eslint-disable-line max-statements,
window.caretBrowsingLoaded = true;
CaretBrowsing.init();
if (document.body.getAttribute("caretbrowsing") === "on") {
if (document.body &&
document.body.getAttribute("caretbrowsing") === "on") {
CaretBrowsing.forceEnabled = true;
CaretBrowsing.isEnabled = true;
CaretBrowsing.updateIsCaretVisible();