diff options
author | anekos | 2011-07-13 14:32:25 +0900 |
---|---|---|
committer | anekos | 2011-07-13 14:32:25 +0900 |
commit | 127d623203df400a9f0d4c48db1d886ba15e40de (patch) | |
tree | ce080aedde360a5386222e905948d1fce291f0b3 | |
parent | 6efe2430a6e93bcab9817c5abdc3019e8c17229f (diff) | |
download | vimperator-plugins-127d623203df400a9f0d4c48db1d886ba15e40de.tar.bz2 |
ダイアログ的なのに対応
-rw-r--r-- | google-plus-commando.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/google-plus-commando.js b/google-plus-commando.js index 49cb99e..736ee2d 100644 --- a/google-plus-commando.js +++ b/google-plus-commando.js @@ -81,6 +81,11 @@ let INFO = })(); + const Names = { + screen: 'zg', + dialog: 'va-Q', + }; + const Elements = { get doc() content.document, get currentEntry () Entry(Elements.doc.querySelector('.a-f-oi-Ai')), @@ -93,7 +98,8 @@ let INFO = ), get submitButton () Elements.postForm.querySelector('[role="button"]'), get notification () Elements.doc.querySelector('#gbi1'), - get screen () Elements.doc.querySelector('.zg') + get screen () Elements.doc.querySelector('.' + Names.screen), + get dialog () Elements.doc.querySelector('.' + Names.dialog) }; function Entry (root) { @@ -204,9 +210,13 @@ let INFO = let xpath = options['hinttags'].split(/\s*\|\s*/).map(removeRoot).concat(ext); - if (Elements.screen) { + + for (let [, name] in Iterator(['screen', 'dialog'])) { + if (!Elements[name]) + continue; xpath.push('div[contains(@class, "CH")]'); - xpath = xpath.map(function (it) '*[@class="zg"]//' + it) + xpath = xpath.map(function (it) String(<>*[contains(@class, "{Names[name]}")]//{it}</>)) + break; } return xpath.map(function (it) '//' + it).join(' | '); |