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

Side by Side Diff: include.postload.js

Issue 4840054052618240: Issue 1428 - Disable "Block Element" on non-HTML pages (Closed)
Patch Set: Created Sept. 25, 2014, 4:15 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« background.js ('K') | « background.js ('k') | popup.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 return r; 462 return r;
463 } else { 463 } else {
464 return u; 464 return u;
465 } 465 }
466 } 466 }
467 467
468 // Content scripts are apparently invoked on non-HTML documents, so we have to 468 // Content scripts are apparently invoked on non-HTML documents, so we have to
469 // check for that before doing stuff. |document instanceof HTMLDocument| check 469 // check for that before doing stuff. |document instanceof HTMLDocument| check
470 // will fail on some sites like planet.mozilla.org because WebKit creates 470 // will fail on some sites like planet.mozilla.org because WebKit creates
471 // Document instances for XHTML documents, have to test the root element. 471 // Document instances for XHTML documents, have to test the root element.
472 if (document.documentElement instanceof HTMLElement) 472 if (document instanceof HTMLDocument)
Thomas Greiner 2014/09/26 10:03:55 What about the comment above?
Sebastian Noack 2014/09/26 10:23:43 That comment is outdated. I have removed it. In fa
Thomas Greiner 2014/09/26 12:48:55 Thanks. I'll ignore the rest of the changes in the
473 { 473 {
474 // Use a contextmenu handler to save the last element the user right-clicked o n. 474 // Use a contextmenu handler to save the last element the user right-clicked o n.
475 // To make things easier, we actually save the DOM event. 475 // To make things easier, we actually save the DOM event.
476 // We have to do this because the contextMenu API only provides a URL, not the actual 476 // We have to do this because the contextMenu API only provides a URL, not the actual
477 // DOM element. 477 // DOM element.
478 document.addEventListener('contextmenu', function(e) { 478 document.addEventListener('contextmenu', function(e) {
479 lastRightClickEvent = e; 479 lastRightClickEvent = e;
480 }, false); 480 }, false);
481 481
482 document.addEventListener("click", function(event) 482 document.addEventListener("click", function(event)
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 currentElement.parentNode.removeChild(currentElement); 624 currentElement.parentNode.removeChild(currentElement);
625 625
626 clickHide_deactivate(); 626 clickHide_deactivate();
627 } 627 }
628 break; 628 break;
629 default: 629 default:
630 sendResponse({}); 630 sendResponse({});
631 break; 631 break;
632 } 632 }
633 }); 633 });
634
635 if (window == window.top)
636 ext.backgroundPage.sendMessage({type: "report-html-page"});
634 } 637 }
OLDNEW
« background.js ('K') | « background.js ('k') | popup.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld