Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: options.js

Issue 29321336: Issue 2381 - Added share overlay to options page (Closed)
Left Patch Set: Created July 2, 2015, 3:25 p.m.
Right Patch Set: Rebased to 4a68f2a456d6 and set strict mode in common.js Created Sept. 23, 2015, 1:54 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « options.html ('k') | skin/common.css » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 20 matching lines...) Expand all
31 } 31 }
32 32
33 Collection.prototype.addItems = function() 33 Collection.prototype.addItems = function()
34 { 34 {
35 var length = Array.prototype.push.apply(this.items, arguments); 35 var length = Array.prototype.push.apply(this.items, arguments);
36 if (length == 0) 36 if (length == 0)
37 return; 37 return;
38 38
39 this.items.sort(function(a, b) 39 this.items.sort(function(a, b)
40 { 40 {
41 var aValue = (a.title || a.url || a.text).toLowerCase(); 41 var aValue = (a.title || a.text || a.url).toLowerCase();
42 var bValue = (b.title || b.url || a.text).toLowerCase(); 42 var bValue = (b.title || b.text || b.url).toLowerCase();
43 return aValue.localeCompare(bValue); 43 return aValue.localeCompare(bValue);
44 }); 44 });
45 45
46 for (var j = 0; j < this.details.length; j++) 46 for (var j = 0; j < this.details.length; j++)
47 { 47 {
48 var table = E(this.details[j].id); 48 var table = E(this.details[j].id);
49 var template = table.querySelector("template"); 49 var template = table.querySelector("template");
50 for (var i = 0; i < arguments.length; i++) 50 for (var i = 0; i < arguments.length; i++)
51 { 51 {
52 var item = arguments[i]; 52 var item = arguments[i];
53 var text = item.title || item.url || item.text; 53 var text = item.title || item.url || item.text;
54 var listItem = document.createElement("li"); 54 var listItem = document.createElement("li");
55 listItem.appendChild(document.importNode(template.content, true)); 55 listItem.appendChild(document.importNode(template.content, true));
56 listItem.dataset.access = item.url || item.text; 56 listItem.setAttribute("data-access", item.url || item.text);
57 listItem.querySelector(".display").textContent = text; 57 listItem.querySelector(".display").textContent = text;
58 if (text) 58 if (text)
59 listItem.dataset.search = text.toLowerCase(); 59 listItem.setAttribute("data-search", text.toLowerCase());
60 60
61 var control = listItem.querySelector(".control"); 61 var control = listItem.querySelector(".control");
62 if (control) 62 if (control)
63 { 63 {
64 control.addEventListener("click", this.details[j].onClick, false); 64 control.addEventListener("click", this.details[j].onClick, false);
65 control.checked = item.disabled == false; 65 control.checked = item.disabled == false;
66 } 66 }
67 67
68 if (table.hasChildNodes()) 68 if (table.hasChildNodes())
69 table.insertBefore(listItem, table.childNodes[this.items.indexOf(item) ]); 69 table.insertBefore(listItem, table.childNodes[this.items.indexOf(item) ]);
(...skipping 28 matching lines...) Expand all
98 var template = table.querySelector("template"); 98 var template = table.querySelector("template");
99 table.innerHTML = ""; 99 table.innerHTML = "";
100 table.appendChild(template); 100 table.appendChild(template);
101 } 101 }
102 this.items.length = 0; 102 this.items.length = 0;
103 }; 103 };
104 104
105 function onToggleSubscriptionClick(e) 105 function onToggleSubscriptionClick(e)
106 { 106 {
107 e.preventDefault(); 107 e.preventDefault();
108 var subscriptionUrl = e.target.parentNode.dataset.access; 108 var subscriptionUrl = e.target.parentNode.getAttribute("data-access");
109 if (!e.target.checked) 109 if (!e.target.checked)
110 removeSubscription(subscriptionUrl); 110 {
111 ext.backgroundPage.sendMessage(
112 {
113 type: "subscriptions.remove",
114 url: subscriptionUrl
115 });
116 }
111 else 117 else
112 addEnableSubscription(subscriptionUrl); 118 addEnableSubscription(subscriptionUrl);
113 } 119 }
114 120
115 function onAddLanguageSubscriptionClick(e) 121 function onAddLanguageSubscriptionClick(e)
116 { 122 {
117 e.preventDefault(); 123 e.preventDefault();
118 var url = this.parentNode.dataset.access; 124 var url = this.parentNode.getAttribute("data-access");
119 addEnableSubscription(url); 125 addEnableSubscription(url);
120 } 126 }
121 127
122 function onRemoveFilterClick() 128 function onRemoveFilterClick()
123 { 129 {
124 var filter = this.parentNode.dataset.access; 130 var filter = this.parentNode.getAttribute("data-access");
125 removeFilter(filter); 131 ext.backgroundPage.sendMessage(
132 {
133 type: "filters.remove",
134 text: filter
135 });
126 } 136 }
127 137
128 collections.popular = new Collection( 138 collections.popular = new Collection(
129 [ 139 [
130 { 140 {
131 id: "recommend-list-table", 141 id: "recommend-list-table",
132 onClick: onToggleSubscriptionClick 142 onClick: onToggleSubscriptionClick
133 } 143 }
134 ]); 144 ]);
135 collections.langs = new Collection( 145 collections.langs = new Collection(
(...skipping 25 matching lines...) Expand all
161 { 171 {
162 id: "custom-list-table", 172 id: "custom-list-table",
163 onClick: onToggleSubscriptionClick 173 onClick: onToggleSubscriptionClick
164 } 174 }
165 ]); 175 ]);
166 collections.whitelist = new Collection( 176 collections.whitelist = new Collection(
167 [ 177 [
168 { 178 {
169 id: "whitelisting-table", 179 id: "whitelisting-table",
170 onClick: onRemoveFilterClick 180 onClick: onRemoveFilterClick
181 }
182 ]);
183 collections.customFilters = new Collection(
184 [
185 {
186 id: "custom-filters-table"
171 } 187 }
172 ]); 188 ]);
173 189
174 function updateSubscription(subscription) 190 function updateSubscription(subscription)
175 { 191 {
176 var subscriptionUrl = subscription.url; 192 var subscriptionUrl = subscription.url;
177 var knownSubscription = subscriptionsMap[subscriptionUrl]; 193 var knownSubscription = subscriptionsMap[subscriptionUrl];
178 if (knownSubscription) 194 if (knownSubscription)
179 knownSubscription.disabled = subscription.disabled; 195 knownSubscription.disabled = subscription.disabled;
180 else 196 else
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 } 275 }
260 } 276 }
261 277
262 function updateFilter(filter) 278 function updateFilter(filter)
263 { 279 {
264 var match = filter.text.match(/^@@\|\|([^\/:]+)\^\$document$/); 280 var match = filter.text.match(/^@@\|\|([^\/:]+)\^\$document$/);
265 if (match && !filtersMap[filter.text]) 281 if (match && !filtersMap[filter.text])
266 { 282 {
267 filter.title = match[1]; 283 filter.title = match[1];
268 collections.whitelist.addItems(filter); 284 collections.whitelist.addItems(filter);
269 filtersMap[filter.text] = filter
270 } 285 }
271 else 286 else
272 { 287 collections.customFilters.addItems(filter);
273 // TODO: add `filters[i].text` to list of custom filters 288
274 } 289 filtersMap[filter.text] = filter;
275 } 290 }
276 291
277 function loadRecommendations() 292 function loadRecommendations()
278 { 293 {
279 var request = new XMLHttpRequest(); 294 var request = new XMLHttpRequest();
280 request.open("GET", "subscriptions.xml", false); 295 request.open("GET", "subscriptions.xml", false);
281 request.addEventListener("load", function() 296 request.addEventListener("load", function()
282 { 297 {
283 var list = document.getElementById("subscriptionSelector"); 298 var list = document.getElementById("subscriptionSelector");
284 var docElem = request.responseXML.documentElement; 299 var docElem = request.responseXML.documentElement;
(...skipping 12 matching lines...) Expand all
297 recommendation.isAdsType = false; 312 recommendation.isAdsType = false;
298 recommendation.isPopular = false; 313 recommendation.isPopular = false;
299 var prefix = element.getAttribute("prefixes"); 314 var prefix = element.getAttribute("prefixes");
300 if (prefix) 315 if (prefix)
301 { 316 {
302 var prefix = element.getAttribute("prefixes").replace(/,/g, "_"); 317 var prefix = element.getAttribute("prefixes").replace(/,/g, "_");
303 subscription.title = ext.i18n.getMessage("options_language_" + prefix) ; 318 subscription.title = ext.i18n.getMessage("options_language_" + prefix) ;
304 recommendation.isAdsType = true; 319 recommendation.isAdsType = true;
305 } 320 }
306 else 321 else
322 {
307 subscription.title = element.getAttribute("specialization"); 323 subscription.title = element.getAttribute("specialization");
308
309 if (element.getAttribute("popular"))
310 recommendation.isPopular = true; 324 recommendation.isPopular = true;
325 }
311 326
312 recommendationsMap[subscription.url] = recommendation; 327 recommendationsMap[subscription.url] = recommendation;
313 updateSubscription(subscription); 328 updateSubscription(subscription);
314 } 329 }
315 }, false); 330 }, false);
316 request.send(null); 331 request.send(null);
332 }
333
334 function onClick(e)
335 {
336 var element = e.target;
337 while (true)
338 {
339 if (!element)
340 return;
341
342 if (element.hasAttribute("data-action"))
343 break;
344
345 element = element.parentElement;
346 }
347
348 var actions = element.getAttribute("data-action").split(",");
349 for (var i = 0; i < actions.length; i++)
350 {
351 switch (actions[i])
352 {
353 case "add-domain-exception":
354 addWhitelistedDomain();
355 break;
356 case "add-predefined-subscription":
357 var dialog = E("dialog-content-predefined");
358 var title = dialog.querySelector("h3").textContent;
359 var url = dialog.querySelector(".url").textContent;
360 addEnableSubscription(url, title);
361 document.body.removeAttribute("data-dialog");
362 break;
363 case "cancel-custom-filters":
364 E("custom-filters").classList.remove("mode-edit");
365 break;
366 case "cancel-domain-exception":
367 E("whitelisting-textbox").value = "";
368 break;
369 case "close-dialog":
370 document.body.removeAttribute("data-dialog");
371 break;
372 case "edit-custom-filters":
373 E("custom-filters").classList.add("mode-edit");
374 editCustomFilters();
375 break;
376 case "import-subscription":
377 var url = E("blockingList-textbox").value;
378 addEnableSubscription(url);
379 document.body.removeAttribute("data-dialog");
380 break;
381 case "open-dialog":
382 openDialog(element.getAttribute("data-dialog"));
383 break;
384 case "save-custom-filters":
385 ext.backgroundPage.sendMessage(
386 {
387 type: "filters.importRaw",
388 text: E("custom-filters-raw").value
389 });
390 E("custom-filters").classList.remove("mode-edit");
391 break;
392 case "switch-tab":
393 document.body.setAttribute("data-tab",
394 element.getAttribute("data-tab"));
395 break;
396 }
397 }
317 } 398 }
318 399
319 function onDOMLoaded() 400 function onDOMLoaded()
320 { 401 {
321 var recommendationTemplate = document.querySelector("#recommend-list-table t emplate"); 402 var recommendationTemplate = document.querySelector("#recommend-list-table t emplate");
322 var popularText = ext.i18n.getMessage("options_popular"); 403 var popularText = ext.i18n.getMessage("options_popular");
323 recommendationTemplate.content.querySelector(".popular").textContent = popul arText; 404 recommendationTemplate.content.querySelector(".popular").textContent = popul arText;
324 var languagesTemplate = document.querySelector("#all-lang-table template"); 405 var languagesTemplate = document.querySelector("#all-lang-table template");
325 var buttonText = ext.i18n.getMessage("options_button_add"); 406 var buttonText = ext.i18n.getMessage("options_button_add");
326 languagesTemplate.content.querySelector(".button-add span").textContent = bu ttonText; 407 languagesTemplate.content.querySelector(".button-add span").textContent = bu ttonText;
327 408
328 populateLists(); 409 populateLists();
329 410
330 var tabList = document.querySelectorAll("#main-navigation-tabs li");
331 for (var i = 0; i < tabList.length; i++)
332 {
333 tabList[i].addEventListener("click", function(e)
334 {
335 document.body.dataset.tab = e.currentTarget.dataset.show;
336 }, false);
337 }
338
339 function onFindLanguageKeyUp() 411 function onFindLanguageKeyUp()
340 { 412 {
341 var searchStyle = E("search-style"); 413 var searchStyle = E("search-style");
342 if (!this.value) 414 if (!this.value)
343 searchStyle.innerHTML = ""; 415 searchStyle.innerHTML = "";
344 else 416 else
345 searchStyle.innerHTML = "#all-lang-table li:not([data-search*=\"" + this .value.toLowerCase() + "\"]) { display: none; }"; 417 searchStyle.innerHTML = "#all-lang-table li:not([data-search*=\"" + this .value.toLowerCase() + "\"]) { display: none; }";
346 } 418 }
347 419
420 function isEnterPressed(e)
421 {
422 // e.keyCode has been deprecated so we attempt to use e.key
423 if ("key" in e)
424 return e.key == "Enter";
425 return e.keyCode == 13; // keyCode "13" corresponds to "Enter"
426 }
427
348 // Initialize navigation sidebar 428 // Initialize navigation sidebar
349 ext.backgroundPage.sendMessage( 429 ext.backgroundPage.sendMessage(
350 { 430 {
351 type: "app.get", 431 type: "app.get",
352 what: "addonVersion" 432 what: "addonVersion"
353 }, 433 },
354 function(addonVersion) 434 function(addonVersion)
355 { 435 {
356 E("abp-version").textContent = addonVersion; 436 E("abp-version").textContent = addonVersion;
357 }); 437 });
358 getDocLink("releases", function(link) 438 getDocLink("releases", function(link)
359 { 439 {
360 E("link-version").setAttribute("href", link); 440 E("link-version").setAttribute("href", link);
361 }); 441 });
362 442
363 getDocLink("contribute", function(link) 443 getDocLink("contribute", function(link)
364 { 444 {
365 document.querySelector("#tab-contribute a").setAttribute("href", link); 445 document.querySelector("#tab-contribute a").setAttribute("href", link);
366 }); 446 });
367 447
368 updateShareLink(); 448 updateShareLink();
369 449
370 // Initialize interactive UI elements 450 // Initialize interactive UI elements
451 document.body.addEventListener("click", onClick, false);
371 var placeholderValue = ext.i18n.getMessage("options_dialog_language_find"); 452 var placeholderValue = ext.i18n.getMessage("options_dialog_language_find");
372 E("find-language").setAttribute("placeholder", placeholderValue); 453 E("find-language").setAttribute("placeholder", placeholderValue);
373 E("add-blocking-list").addEventListener("click", function()
374 {
375 openDialog("customlist");
376 }, false);
377 E("add-website-language").addEventListener("click", function()
378 {
379 openDialog("language");
380 }, false);
381 E("dialog-close").addEventListener("click", function()
382 {
383 delete document.body.dataset.dialog;
384 }, false);
385 E("edit-ownBlockingList-button").addEventListener("click", editCustomFilters , false);
386 E("find-language").addEventListener("keyup", onFindLanguageKeyUp, false); 454 E("find-language").addEventListener("keyup", onFindLanguageKeyUp, false);
387 E("whitelisting").addEventListener("click", function(e)
388 {
389 var id = e.target.id;
390 if (id == "whitelisting-add-icon" || id == "whitelisting-enter-icon")
391 addWhitelistedDomain();
392 else if (id == "whitelisting-cancel-button")
393 E("whitelisting-textbox").value = "";
394 }, false);
395 E("whitelisting-add-button").addEventListener("click", addWhitelistedDomain, false);
396 E("whitelisting-textbox").addEventListener("keypress", function(e) 455 E("whitelisting-textbox").addEventListener("keypress", function(e)
397 { 456 {
398 // e.keyCode has been deprecated so we attempt to use e.key 457 if (isEnterPressed(e))
399 // keyCode "13" corresponds to "Enter"
400 if ((e.key && e.key == "Enter") || (!e.key && e.keyCode == 13))
401 addWhitelistedDomain(); 458 addWhitelistedDomain();
402 }, false); 459 }, false);
403 E("import-blockingList-button").addEventListener("click", function() 460
404 { 461 // Advanced tab
405 var url = E("blockingList-textbox").value; 462 var filterTextbox = document.querySelector("#custom-filters-add input");
406 addEnableSubscription(url); 463 placeholderValue = ext.i18n.getMessage("options_customFilters_textbox_placeh older");
407 delete document.body.dataset.dialog; 464 filterTextbox.setAttribute("placeholder", placeholderValue);
465 function addCustomFilters()
466 {
467 var filterText = filterTextbox.value;
468 ext.backgroundPage.sendMessage(
469 {
470 type: "filters.add",
471 text: filterText
472 });
473 filterTextbox.value = "";
474 }
475 E("custom-filters-add").addEventListener("submit", function(e)
476 {
477 e.preventDefault();
478 addCustomFilters();
408 }, false); 479 }, false);
480 var customFilterEditButtons = document.querySelectorAll("#custom-filters-edi t-wrapper button");
409 } 481 }
410 482
411 function openDialog(name) 483 function openDialog(name)
412 { 484 {
413 document.body.dataset.dialog = name; 485 document.body.setAttribute("data-dialog", name);
414 } 486 }
415 487
416 function populateLists() 488 function populateLists()
417 { 489 {
418 subscriptionsMap = Object.create(null); 490 subscriptionsMap = Object.create(null);
419 filtersMap = Object.create(null); 491 filtersMap = Object.create(null);
420 recommendationsMap = Object.create(null); 492 recommendationsMap = Object.create(null);
421 493
422 // Empty collections and lists 494 // Empty collections and lists
423 for (var property in collections) 495 for (var property in collections)
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 type: "filters.add", 550 type: "filters.add",
479 text: "@@||" + domain.value.toLowerCase() + "^$document" 551 text: "@@||" + domain.value.toLowerCase() + "^$document"
480 }); 552 });
481 } 553 }
482 554
483 domain.value = ""; 555 domain.value = "";
484 } 556 }
485 557
486 function editCustomFilters() 558 function editCustomFilters()
487 { 559 {
488 //TODO: NYI 560 var customFilterItems = collections.customFilters.items;
561 var filterTexts = [];
562 for (var i = 0; i < customFilterItems.length; i++)
563 filterTexts.push(customFilterItems[i].text);
564 E("custom-filters-raw").value = filterTexts.join("\n");
489 } 565 }
490 566
491 function getAcceptableAdsURL(callback) 567 function getAcceptableAdsURL(callback)
492 { 568 {
493 ext.backgroundPage.sendMessage( 569 ext.backgroundPage.sendMessage(
494 { 570 {
495 type: "prefs.get", 571 type: "prefs.get",
496 key: "subscriptions_exceptionsurl" 572 key: "subscriptions_exceptionsurl"
497 }, 573 },
498 function(value) 574 function(value)
(...skipping 20 matching lines...) Expand all
519 url: url 595 url: url
520 }; 596 };
521 if (title) 597 if (title)
522 message.title = title; 598 message.title = title;
523 if (homepage) 599 if (homepage)
524 message.homepage = homepage; 600 message.homepage = homepage;
525 601
526 ext.backgroundPage.sendMessage(message); 602 ext.backgroundPage.sendMessage(message);
527 } 603 }
528 604
529 function removeSubscription(url)
530 {
531 ext.backgroundPage.sendMessage(
532 {
533 type: "subscriptions.remove",
534 url: url
535 });
536 }
537
538 function removeFilter(filter)
539 {
540 ext.backgroundPage.sendMessage(
541 {
542 type: "filters.remove",
543 text: filter
544 });
545 }
546
547 function onFilterMessage(action, filter) 605 function onFilterMessage(action, filter)
548 { 606 {
549 switch (action) 607 switch (action)
550 { 608 {
551 case "added": 609 case "added":
552 updateFilter(filter); 610 updateFilter(filter);
553 updateShareLink(); 611 updateShareLink();
554 break; 612 break;
555 case "loaded": 613 case "loaded":
556 populateLists(); 614 populateLists();
557 break; 615 break;
558 case "removed": 616 case "removed":
559 var knownFilter = filtersMap[filter.text]; 617 var knownFilter = filtersMap[filter.text];
560 collections.whitelist.removeItem(knownFilter); 618 collections.whitelist.removeItem(knownFilter);
619 collections.customFilters.removeItem(knownFilter);
561 delete filtersMap[filter.text]; 620 delete filtersMap[filter.text];
562 updateShareLink(); 621 updateShareLink();
563 break; 622 break;
564 } 623 }
565 } 624 }
566 625
567 function onSubscriptionMessage(action, subscription) 626 function onSubscriptionMessage(action, subscription)
568 { 627 {
569 switch (action) 628 switch (action)
570 { 629 {
(...skipping 26 matching lines...) Expand all
597 } 656 }
598 updateShareLink(); 657 updateShareLink();
599 }); 658 });
600 break; 659 break;
601 case "title": 660 case "title":
602 // TODO: NYI 661 // TODO: NYI
603 break; 662 break;
604 } 663 }
605 } 664 }
606 665
607 function showAddSubscriptionDialog(subscription)
608 {
609 E("blockingList-textbox").value = subscription.url;
610 openDialog("customlist");
611 }
612
613 function onShareLinkClick(e) 666 function onShareLinkClick(e)
614 { 667 {
615 e.preventDefault(); 668 e.preventDefault();
616 669
617 getDocLink("share-general", function(link) 670 getDocLink("share-general", function(link)
618 { 671 {
619 openSharePopup(link); 672 openSharePopup(link);
620 }); 673 });
621 } 674 }
622 675
(...skipping 27 matching lines...) Expand all
650 for (var i = 0; i < shareResources.length; i++) 703 for (var i = 0; i < shareResources.length; i++)
651 checkShareResource(shareResources[i], onResult); 704 checkShareResource(shareResources[i], onResult);
652 } 705 }
653 706
654 ext.onMessage.addListener(function(message) 707 ext.onMessage.addListener(function(message)
655 { 708 {
656 switch (message.type) 709 switch (message.type)
657 { 710 {
658 case "app.listen": 711 case "app.listen":
659 if (message.action == "addSubscription") 712 if (message.action == "addSubscription")
660 showAddSubscriptionDialog(message.args[0]); 713 {
714 var subscription = message.args[0];
715 var dialog = E("dialog-content-predefined");
716 dialog.querySelector("h3").textContent = subscription.title || "";
717 dialog.querySelector(".url").textContent = subscription.url;
718 openDialog("predefined");
719 }
720 else if (message.action == "error")
721 {
722 alert(message.args.join("\n"));
723 }
661 break; 724 break;
662 case "filters.listen": 725 case "filters.listen":
663 onFilterMessage(message.action, message.args[0]); 726 onFilterMessage(message.action, message.args[0]);
664 break; 727 break;
665 case "subscriptions.listen": 728 case "subscriptions.listen":
666 onSubscriptionMessage(message.action, message.args[0]); 729 onSubscriptionMessage(message.action, message.args[0]);
667 break; 730 break;
668 } 731 }
669 }); 732 });
670 733
671 ext.backgroundPage.sendMessage( 734 ext.backgroundPage.sendMessage(
672 { 735 {
673 type: "app.listen", 736 type: "app.listen",
674 filter: ["addSubscription"] 737 filter: ["addSubscription", "error"]
675 }); 738 });
676 ext.backgroundPage.sendMessage( 739 ext.backgroundPage.sendMessage(
677 { 740 {
678 type: "filters.listen", 741 type: "filters.listen",
679 filter: ["added", "loaded", "removed"] 742 filter: ["added", "loaded", "removed"]
680 }); 743 });
681 ext.backgroundPage.sendMessage( 744 ext.backgroundPage.sendMessage(
682 { 745 {
683 type: "subscriptions.listen", 746 type: "subscriptions.listen",
684 filter: ["added", "disabled", "homepage", "removed", "title"] 747 filter: ["added", "disabled", "homepage", "removed", "title"]
685 }); 748 });
686 749
687 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); 750 window.addEventListener("DOMContentLoaded", onDOMLoaded, false);
688 })(); 751 })();
LEFTRIGHT

Powered by Google App Engine
This is Rietveld