aboutsummaryrefslogtreecommitdiffstats
path: root/popup.html
blob: e3feac447e373e3dfa3ade688999ade4559e390f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<style>
  #vimiumPopup { width: 300px; }
  #popupInput { width: 200px; }
  #popupButton { margin-left: 10px; }
</style>

<div id="vimiumPopup">
  <input id="popupInput" type="text" />
  <input id="popupButton" type="button" value="Exclude URL" />
</div>

<script type="text/javascript">
  function onLoad() {
    chrome.tabs.getSelected(null, function(tab) {
      document.getElementById("popupInput").value = tab.url;
    });
  }

  function onExcludeUrl(e) {
    var url = document.getElementById("popupInput").value;
    chrome.extension.getBackgroundPage().addExcludedUrl(url);
  }

  window.addEventListener("load", onLoad, false);
  document.getElementById("popupButton").addEventListener("click", onExcludeUrl, false);
</script>