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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 document.addEventListener("click", clickHide_mouseClick, true); | 323 document.addEventListener("click", clickHide_mouseClick, true); |
324 document.addEventListener("keydown", clickHide_keyDown, true); | 324 document.addEventListener("keydown", clickHide_keyDown, true); |
325 | 325 |
326 ext.onExtensionUnloaded.addListener(clickHide_deactivate); | 326 ext.onExtensionUnloaded.addListener(clickHide_deactivate); |
327 } | 327 } |
328 | 328 |
329 // Called when user has clicked on something and we are waiting for confirmation | 329 // Called when user has clicked on something and we are waiting for confirmation |
330 // on whether the user actually wants these filters | 330 // on whether the user actually wants these filters |
331 function clickHide_rulesPending() { | 331 function clickHide_rulesPending() { |
332 clickHide_activated = false; | 332 clickHide_activated = false; |
| 333 |
| 334 if (clickHideFiltersDialog) |
| 335 { |
| 336 document.documentElement.removeChild(clickHideFiltersDialog); |
| 337 clickHideFiltersDialog = null; |
| 338 } |
| 339 |
333 document.removeEventListener("mousedown", clickHide_stopPropagation, true); | 340 document.removeEventListener("mousedown", clickHide_stopPropagation, true); |
334 document.removeEventListener("mouseup", clickHide_stopPropagation, true); | 341 document.removeEventListener("mouseup", clickHide_stopPropagation, true); |
335 document.removeEventListener("mouseenter", clickHide_stopPropagation, true); | 342 document.removeEventListener("mouseenter", clickHide_stopPropagation, true); |
336 document.removeEventListener("mouseleave", clickHide_stopPropagation, true); | 343 document.removeEventListener("mouseleave", clickHide_stopPropagation, true); |
337 document.removeEventListener("mouseover", clickHide_mouseOver, true); | 344 document.removeEventListener("mouseover", clickHide_mouseOver, true); |
338 document.removeEventListener("mouseout", clickHide_mouseOut, true); | 345 document.removeEventListener("mouseout", clickHide_mouseOut, true); |
339 document.removeEventListener("click", clickHide_mouseClick, true); | 346 document.removeEventListener("click", clickHide_mouseClick, true); |
340 document.removeEventListener("keydown", clickHide_keyDown, true); | 347 document.removeEventListener("keydown", clickHide_keyDown, true); |
341 } | 348 } |
342 | 349 |
343 function clickHide_deactivate() | 350 function clickHide_deactivate() |
344 { | 351 { |
345 clickHide_rulesPending(); | 352 clickHide_rulesPending(); |
346 | 353 |
347 if (clickHideFiltersDialog) | |
348 { | |
349 document.documentElement.removeChild(clickHideFiltersDialog); | |
350 clickHideFiltersDialog = null; | |
351 } | |
352 | |
353 clickHide_filters = null; | 354 clickHide_filters = null; |
354 lastRightClickEvent = null; | 355 lastRightClickEvent = null; |
355 | 356 |
356 if (currentElement) | 357 if (currentElement) |
357 { | 358 { |
358 currentElement.removeEventListener("contextmenu", clickHide_elementClickHan
dler, true); | 359 currentElement.removeEventListener("contextmenu", clickHide_elementClickHan
dler, true); |
359 unhighlightElements(); | 360 unhighlightElements(); |
360 unhighlightElement(currentElement); | 361 unhighlightElement(currentElement); |
361 currentElement = null; | 362 currentElement = null; |
362 } | 363 } |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 lastRightClickEventValid = false; | 743 lastRightClickEventValid = false; |
743 else | 744 else |
744 lastRightClickEvent = null; | 745 lastRightClickEvent = null; |
745 break; | 746 break; |
746 } | 747 } |
747 }); | 748 }); |
748 | 749 |
749 if (window == window.top) | 750 if (window == window.top) |
750 ext.backgroundPage.sendMessage({type: "report-html-page"}); | 751 ext.backgroundPage.sendMessage({type: "report-html-page"}); |
751 } | 752 } |
OLD | NEW |