From 81d5d2673828d72cc52cd2ae2039916ed7c708a4 Mon Sep 17 00:00:00 2001
From: anekos
Date: Tue, 31 Mar 2009 19:13:40 +0000
Subject: typo とか色々修正
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@31756 d0d07461-0603-4401-acd4-de1884942a52
---
auto-focus-frame.js | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
(limited to 'auto-focus-frame.js')
diff --git a/auto-focus-frame.js b/auto-focus-frame.js
index adc9be1..3d49ff8 100644
--- a/auto-focus-frame.js
+++ b/auto-focus-frame.js
@@ -38,7 +38,7 @@ let PLUGIN_INFO =
Auto focus frame
Automatically focus to largest frame.
最も大きなフレームに自動的にフォーカスする。
- 1.0.0
+ 1.0.1
anekos
new BSD License (Please read the source code comments of this plugin)
修正BSDライセンス (ソースコードのコメントを参照してください)
@@ -68,13 +68,18 @@ let PLUGIN_INFO =
return;
let [maxSize, maxFrame] = [-1, content.frames[0]];
for (let frame in util.Array.iterator(content.frames)) {
- let size = frame.innerHeight * frame.innerWidth;
- win = window.content;
- if (win.scrollMaxX <= 0 && win.scrollMaxY <= 0)
- continue;
- if (maxSize < size) {
- maxSize = size;
- maxFrame = frame;
+ try {
+ if (frame.scrollMaxX <= 0 && frame.scrollMaxY <= 0)
+ continue;
+ let doc = frame.document;
+ let size = doc.width * doc.height;
+ if (maxSize < size) {
+ maxSize = size;
+ maxFrame = frame;
+ }
+ } catch (e) {
+ liberator.log(e)
+ continue;
}
}
maxFrame.focus();
--
cgit v1.2.3