From 35ab4dbd630df9119b81852b6da9e8839dde45e5 Mon Sep 17 00:00:00 2001 From: Phil Crosby Date: Sun, 6 Dec 2009 16:38:24 -0800 Subject: Guard against trying to use the HUD prior to document.body being ready. Closes #25. --- vimiumFrontend.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vimiumFrontend.js b/vimiumFrontend.js index 876164d2..31ac1e01 100644 --- a/vimiumFrontend.js +++ b/vimiumFrontend.js @@ -108,7 +108,8 @@ function saveZoomLevel(domain, zoomLevel) { */ function setPageZoomLevel(zoomLevel, showUINotification) { document.documentElement.style.zoom = zoomLevel + "%"; - HUD.updatePageZoomLevel(zoomLevel); + if (document.body) + HUD.updatePageZoomLevel(zoomLevel); if (showUINotification) HUD.showForDuration("Zoom: " + currentZoomLevel + "%", 1000); } @@ -292,6 +293,10 @@ function exitFindMode() { HUD.hide(); } +/* + * A heads-up-display for showing Vimium page operations. + * Note: you cannot interact with the HUD until document.body is available. + */ HUD = { showForDuration: function(text, duration) { HUD.show(text); -- cgit v1.2.3