Index: block.js |
=================================================================== |
--- a/block.js |
+++ b/block.js |
@@ -64,12 +64,20 @@ |
function addFilters() |
{ |
- // Tell the background page to add the filters |
- var filters = document.getElementById("filters").value.split(/[\r\n]+/) |
- .map(function(f) {return f.replace(/^\s+/, "").replace(/\s+$/, "");}) |
- .filter(function(f) {return f != "";}); |
- ext.backgroundPage.sendMessage({type: "add-filters", filters: filters}); |
- closeDialog(true); |
+ ext.backgroundPage.sendMessage( |
+ { |
+ type: "add-filters", |
+ text: document.getElementById("filters").value |
+ }, |
+ |
+ function(response) |
+ { |
+ if (response.status == "ok") |
+ closeDialog(true); |
+ else |
+ alert(response.error); |
+ } |
+ ); |
} |
function closeDialog(success) |