aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel MacDougall2012-03-28 18:54:24 -0700
committerDaniel MacDougall2012-03-28 18:55:52 -0700
commitc33bf2d3abd397df572e0ace6cc6eb00e0549565 (patch)
treeaebb350ab3732a5a6ab634204b55bb3eb984a51a
parent801a20fb28cbd13b057668d495cfe54c645c651b (diff)
downloadvimium-c33bf2d3abd397df572e0ace6cc6eb00e0549565.tar.bz2
Populate exclude input with <domain>/* by default
-rw-r--r--popup.html5
1 files changed, 4 insertions, 1 deletions
diff --git a/popup.html b/popup.html
index e3feac44..bab3b7b6 100644
--- a/popup.html
+++ b/popup.html
@@ -12,7 +12,10 @@
<script type="text/javascript">
function onLoad() {
chrome.tabs.getSelected(null, function(tab) {
- document.getElementById("popupInput").value = tab.url;
+ // The common use case is to disable Vimium at the domain level.
+ // This regexp will match "http://www.example.com/" from "http://www.example.com/path/to/page.html".
+ var domain = tab.url.match(/[^\/]*\/\/[^\/]*\//) || tab.url;
+ document.getElementById("popupInput").value = domain + "*";
});
}