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

Delta Between Two Patch Sets: lib/ui.js

Issue 29329450: Issue 3208 - Don`t use numerical content types outside nsIContentPolicy.shouldLoad (Closed)
Left Patch Set: Created Oct. 28, 2015, 2:42 p.m.
Right Patch Set: Removed unrelated change Created Nov. 4, 2015, 9:27 a.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 | « lib/requestNotifier.js ('k') | no next file » | 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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 let button = window.document.getElementById("abp-toolbarbutton") 436 let button = window.document.getElementById("abp-toolbarbutton")
437 || window.document.getElementById("abp-status"); 437 || window.document.getElementById("abp-status");
438 if (!button) 438 if (!button)
439 return; 439 return;
440 440
441 this._showNotification(window, button, notification); 441 this._showNotification(window, button, notification);
442 }); 442 });
443 443
444 // Add "anti-adblock messages" notification 444 // Add "anti-adblock messages" notification
445 initAntiAdblockNotification(); 445 initAntiAdblockNotification();
446
447 let documentCreationObserver = {
448 observe: function(subject, topic, data)
449 {
450 if (!(subject instanceof Ci.nsIDOMWindow))
451 return;
452
453 Notification.showNext(subject.location.href);
454 }.bind(UI)
455 };
456 Services.obs.addObserver(documentCreationObserver, "content-document-global- created", false);
457 onShutdown.add(function()
458 {
459 Services.obs.removeObserver(documentCreationObserver, "content-document-gl obal-created", false);
460 });
461 446
462 // Frame script URL has to be randomized due to caching 447 // Frame script URL has to be randomized due to caching
463 // (see https://bugzilla.mozilla.org/show_bug.cgi?id=1051238) 448 // (see https://bugzilla.mozilla.org/show_bug.cgi?id=1051238)
464 let frameScript = "chrome://adblockplus/content/subscribeLinkHandler.js?" + Math.random(); 449 let frameScript = "chrome://adblockplus/content/subscribeLinkHandler.js?" + Math.random();
465 450
466 // Initialize subscribe link handling 451 // Initialize subscribe link handling
467 let callback = this.subscribeLinkClicked.bind(this); 452 let callback = this.subscribeLinkClicked.bind(this);
468 let messageManager = Cc["@mozilla.org/globalmessagemanager;1"] 453 let messageManager = Cc["@mozilla.org/globalmessagemanager;1"]
469 .getService(Ci.nsIMessageListenerManager); 454 .getService(Ci.nsIMessageListenerManager);
470 messageManager.loadFrameScript(frameScript, true); 455 messageManager.loadFrameScript(frameScript, true);
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 if (element) 586 if (element)
602 element.addEventListener(event, handler.bind(null, window), false); 587 element.addEventListener(event, handler.bind(null, window), false);
603 } 588 }
604 window.addEventListener("popupshowing", this.onPopupShowing, false); 589 window.addEventListener("popupshowing", this.onPopupShowing, false);
605 window.addEventListener("keypress", this.onKeyPress, false); 590 window.addEventListener("keypress", this.onKeyPress, false);
606 591
607 addBrowserLocationListener(window, function() 592 addBrowserLocationListener(window, function()
608 { 593 {
609 this.updateIconState(window, window.document.getElementById("abp-status")) ; 594 this.updateIconState(window, window.document.getElementById("abp-status")) ;
610 this.updateIconState(window, window.document.getElementById("abp-toolbarbu tton")); 595 this.updateIconState(window, window.document.getElementById("abp-toolbarbu tton"));
596
597 Notification.showNext(this.getCurrentLocation(window).spec);
611 }.bind(this)); 598 }.bind(this));
612 599
613 let notificationPanel = window.document.getElementById("abp-notification"); 600 let notificationPanel = window.document.getElementById("abp-notification");
614 notificationPanel.addEventListener("command", function(event) 601 notificationPanel.addEventListener("command", function(event)
615 { 602 {
616 switch (event.target.id) 603 switch (event.target.id)
617 { 604 {
618 case "abp-notification-close": 605 case "abp-notification-close":
619 notificationPanel.classList.add("abp-closing"); 606 notificationPanel.classList.add("abp-closing");
620 break; 607 break;
(...skipping 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after
1941 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)], 1928 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)],
1942 ["abp-command-toggleshownotifications", "command", Notification.toggleIgnoreCa tegory.bind(Notification, "*", null)] 1929 ["abp-command-toggleshownotifications", "command", Notification.toggleIgnoreCa tegory.bind(Notification, "*", null)]
1943 ]; 1930 ];
1944 1931
1945 onShutdown.add(function() 1932 onShutdown.add(function()
1946 { 1933 {
1947 for (let window of UI.applicationWindows) 1934 for (let window of UI.applicationWindows)
1948 if (UI.isBottombarOpen(window)) 1935 if (UI.isBottombarOpen(window))
1949 UI.toggleBottombar(window); 1936 UI.toggleBottombar(window);
1950 }); 1937 });
LEFTRIGHT

Powered by Google App Engine
This is Rietveld