diff options
author | anekos | 2008-11-23 00:51:13 +0000 |
---|---|---|
committer | anekos | 2008-11-23 00:51:13 +0000 |
commit | 238d125adfbabb3bdb9671e5142f5128a1d31d44 (patch) | |
tree | 48d5ca76919cf174a18e54101a55c75b56bf36a9 | |
parent | 2f5f4c114977f767e26ab17a9652111cbdab7555 (diff) | |
download | vimperator-plugins-238d125adfbabb3bdb9671e5142f5128a1d31d44.tar.bz2 |
succ する際に全てのフレームのURLを参考にするようにした。
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@24679 d0d07461-0603-4401-acd4-de1884942a52
-rw-r--r-- | auto_detect_link.js | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/auto_detect_link.js b/auto_detect_link.js index 136878e..b6fdb8f 100644 --- a/auto_detect_link.js +++ b/auto_detect_link.js @@ -318,6 +318,18 @@ } + // 全フレームの URL を得る + function getAllLocations (content) { + let result = [content.location.href]; + if (content.frames) { + for (let i = 0, l = content.frames.length; i < l; i++) { + result = result.concat(getAllLocations(content.frames[i])); + } + } + return result; + } + + // 上書きした設定を返す。 function getCurrentSetting (setting) { if (!setting) @@ -410,7 +422,10 @@ } // succ - let succs = succURI(uri, next); + let succs = []; + getAllLocations(window.content).forEach(function (uri) { + succs = succs.concat(succURI(uri, next)); + }); if (setting.useSuccPattern) { let link; if (succs.some(function (succ) { @@ -421,13 +436,14 @@ } // force - if (setting.force && succs.length) + if (setting.force && succs.length) { return { type: 'force', uri: succs[0], text: '-force-', frame: window.content, }; + } } catch (e) { liberator.log(e); |