From 7e78694b3b7612f3a72bc103679d16ac3a74c5ac Mon Sep 17 00:00:00 2001
From: Daniel Carl <danielcarl@gmx.de>
Date: Wed, 27 Mar 2013 00:23:27 +0100
Subject: [PATCH] Fixed broken hints on pages with frames.

If pages contains pages with content from other domains, we can't process them
because of the same origin policy. In this case the window.document is
undefined and no hint could be shown. To solve the problem, we leaf the
hinting helper if we cant access the document.
---
 src/hints.js | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/hints.js b/src/hints.js
index 542a386..f6c27ab 100644
--- a/src/hints.js
+++ b/src/hints.js
@@ -20,6 +20,11 @@ function VimbHints(mode, usage, bg, bgf, fg, style, maxHints)
 
         function _helper(win, offsetX, offsetY)
         {
+            /* document may be undefined for frames out of the same origin
+             * policy and will break the whole code - so we check this before */
+            if (typeof(win.document) === 'undefined') {
+                return;
+            }
             var doc = win.document;
 
             var fragment = doc.createDocumentFragment();
-- 
2.20.1