diff options
| -rw-r--r-- | background_page.html | 6 | ||||
| -rw-r--r-- | manifest.json | 3 | ||||
| -rw-r--r-- | popup.html | 27 |
3 files changed, 35 insertions, 1 deletions
diff --git a/background_page.html b/background_page.html index 881024c3..b80f49b4 100644 --- a/background_page.html +++ b/background_page.html @@ -113,6 +113,12 @@ return { isEnabledForUrl: isEnabled }; } + function addExcludedUrl(url) { + var excludedUrls = settings.get("excludedUrls"); + excludedUrls += "\n" + url; + settings.set("excludedUrls", excludedUrls); + } + function saveHelpDialogSettings(request) { settings.set("helpDialog_showAdvancedCommands", request.showAdvancedCommands); } diff --git a/manifest.json b/manifest.json index 31b9e976..72631a94 100644 --- a/manifest.json +++ b/manifest.json @@ -31,6 +31,7 @@ } ], "browser_action": { - "default_icon": "icons/icon48disabled.png" + "default_icon": "icons/icon48disabled.png", + "popup": "popup.html" } } diff --git a/popup.html b/popup.html new file mode 100644 index 00000000..e3feac44 --- /dev/null +++ b/popup.html @@ -0,0 +1,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> + |
