diff options
| author | Phil Crosby | 2012-08-19 09:58:57 -0700 | 
|---|---|---|
| committer | Phil Crosby | 2012-08-19 09:58:57 -0700 | 
| commit | 3001bdc53c160c3606ef6903d71db675f4ffcb9a (patch) | |
| tree | e2937f83b7a928a3bd0914f9e43e15c7304b9344 /popup.js | |
| parent | 486ba68a42e2ba7b96a7a14b0ae34aca7ac7e780 (diff) | |
| parent | 038ae30e4275aa5b59d84833f2cdca38a40bfc71 (diff) | |
| download | vimium-3001bdc53c160c3606ef6903d71db675f4ffcb9a.tar.bz2 | |
Merge pull request #618 from dmacdougall/browser_action_icon
Re-enable browser action icon
Diffstat (limited to 'popup.js')
| -rw-r--r-- | popup.js | 20 | 
1 files changed, 20 insertions, 0 deletions
| diff --git a/popup.js b/popup.js new file mode 100644 index 00000000..859f30f3 --- /dev/null +++ b/popup.js @@ -0,0 +1,20 @@ +function onLoad() { +  document.getElementById("optionsLink").setAttribute("href", chrome.extension.getURL("options.html")); +  chrome.tabs.getSelected(null, function(tab) { +    // 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 + "*"; +  }); +} + +function onExcludeUrl(e) { +  var url = document.getElementById("popupInput").value; +  chrome.extension.getBackgroundPage().addExcludedUrl(url); +  document.getElementById("excludeConfirm").setAttribute("style", "display: inline-block"); +} + +document.addEventListener("DOMContentLoaded", function() { +  document.getElementById("popupButton").addEventListener("click", onExcludeUrl, false); +  onLoad(); +}); | 
