OLD | NEW |
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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 clickHide_mouseClick(ev); | 412 clickHide_mouseClick(ev); |
413 } | 413 } |
414 | 414 |
415 // Hovering over an element so highlight it | 415 // Hovering over an element so highlight it |
416 function clickHide_mouseOver(e) | 416 function clickHide_mouseOver(e) |
417 { | 417 { |
418 if (clickHide_activated == false) | 418 if (clickHide_activated == false) |
419 return; | 419 return; |
420 | 420 |
421 var target = e.target; | 421 var target = e.target; |
422 while (target.parentNode && !isBlockable(target)) | 422 while (target.parentNode && !(target instanceof HTMLElement && isBlockable(tar
get))) |
423 target = target.parentNode; | 423 target = target.parentNode; |
424 if (target == document.documentElement || target == document.body) | 424 if (target == document.documentElement || target == document.body) |
425 target = null; | 425 target = null; |
426 | 426 |
427 if (target && target instanceof HTMLElement) | 427 if (target) |
428 { | 428 { |
429 currentElement = target; | 429 currentElement = target; |
430 | 430 |
431 highlightElement(target, "#d6d84b", "#f8fa47"); | 431 highlightElement(target, "#d6d84b", "#f8fa47"); |
432 target.addEventListener("contextmenu", clickHide_elementClickHandler, true); | 432 target.addEventListener("contextmenu", clickHide_elementClickHandler, true); |
433 } | 433 } |
434 } | 434 } |
435 | 435 |
436 // No longer hovering over this element so unhighlight it | 436 // No longer hovering over this element so unhighlight it |
437 function clickHide_mouseOut(e) | 437 function clickHide_mouseOut(e) |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 lastRightClickEventValid = false; | 729 lastRightClickEventValid = false; |
730 else | 730 else |
731 lastRightClickEvent = null; | 731 lastRightClickEvent = null; |
732 break; | 732 break; |
733 } | 733 } |
734 }); | 734 }); |
735 | 735 |
736 if (window == window.top) | 736 if (window == window.top) |
737 ext.backgroundPage.sendMessage({type: "report-html-page"}); | 737 ext.backgroundPage.sendMessage({type: "report-html-page"}); |
738 } | 738 } |
OLD | NEW |