diff options
| author | Stephen Blott | 2015-05-01 11:01:31 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-05-01 11:12:27 +0100 |
| commit | 58ba1ac14870d1614cbdd13f9ea157ff22bdd879 (patch) | |
| tree | dbffce778c2aee2d0a3cc2cd191ef169b2749dc8 | |
| parent | cc1aacdd24aecb2bf1bb6436553c0318bdc6658b (diff) | |
| download | vimium-58ba1ac14870d1614cbdd13f9ea157ff22bdd879.tar.bz2 | |
Ensure frames is defined.
When we reinject content scripts into a tab where document.body is a
frameset, no frames are registered, which causes frames to be undefined.
| -rw-r--r-- | background_scripts/main.coffee | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 3a3392d8..37c65592 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -618,6 +618,7 @@ handleFrameFocused = (request, sender) -> # Rotate through frames to the frame count places after frameId. cycleToFrame = (frames, frameId, count = 0) -> + frames ||= [] # We can't always track which frame chrome has focussed, but here we learn that it's frameId; so add an # additional offset such that we do indeed start from frameId. count = (count + Math.max 0, frames.indexOf frameId) % frames.length |
