aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorilya2011-03-17 17:46:42 -0700
committerilya2011-03-17 17:46:42 -0700
commitaec03312b0f3d170e666e506205168709c305189 (patch)
treedbfe643d8649aca6d0fac7883e43847223d82af4
parent39f8f2ee515a2ec139f46bf17e51f9b90aaa7e5c (diff)
downloadvimium-aec03312b0f3d170e666e506205168709c305189.tar.bz2
Don't gobble escape unless we're on a Google domain -- for the good people at Quora.
-rw-r--r--vimiumFrontend.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/vimiumFrontend.js b/vimiumFrontend.js
index 2ab54427..cc97da93 100644
--- a/vimiumFrontend.js
+++ b/vimiumFrontend.js
@@ -44,6 +44,7 @@ var textInputXPath = '//input[' +
frameId = Math.floor(Math.random()*999999999)
var hasModifiersRegex = /^<([amc]-)+.>/;
+var googleRegex = /:\/\/[^/]*google[^/]+/;
function getSetting(key) {
if (!settingPort)
@@ -399,8 +400,8 @@ function onKeydown(event) {
exitInsertMode();
// Added to prevent Google Instant from reclaiming the keystroke and putting us back into the search box.
- // TOOD(ilya): Revisit this. Not sure it's the absolute best approach.
- event.stopPropagation();
+ if (isGoogleSearch())
+ event.stopPropagation();
}
}
else if (findMode)
@@ -459,6 +460,12 @@ function checkIfEnabledForUrl() {
});
}
+// TODO(ilya): This just checks if "google" is in the domain name. Probably should be more targeted.
+function isGoogleSearch() {
+ var url = window.location.toString();
+ return !!url.match(googleRegex);
+}
+
function refreshCompletionKeys(response) {
if (response) {
currentCompletionKeys = response.completionKeys;