| OLD | NEW |
| 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-2013 Eyeo GmbH | 3 * Copyright (C) 2006-2013 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 if (tag in typeMap && event.type == expectedEvent) | 74 if (tag in typeMap && event.type == expectedEvent) |
| 75 { | 75 { |
| 76 // This element failed loading, did we block it? | 76 // This element failed loading, did we block it? |
| 77 var url = target.src; | 77 var url = target.src; |
| 78 if (!url) | 78 if (!url) |
| 79 return; | 79 return; |
| 80 | 80 |
| 81 var type = typeMap[tag]; | 81 var type = typeMap[tag]; |
| 82 chrome.extension.sendRequest({reqtype: "should-collapse", url: url, document
Url: document.URL, type: type}, function(response) | 82 chrome.extension.sendRequest({reqtype: "should-collapse", url: url, document
Url: document.URL, type: type}, function(response) |
| 83 { | 83 { |
| 84 if (response && target.parentNode) | 84 if (response === true && target.parentNode) |
| 85 { | 85 { |
| 86 // <frame> cannot be removed, doing that will mess up the frameset | 86 // <frame> cannot be removed, doing that will mess up the frameset |
| 87 if (tag == "frame") | 87 if (tag == "frame") |
| 88 target.style.setProperty("visibility", "hidden", "!important"); | 88 target.style.setProperty("visibility", "hidden", "!important"); |
| 89 else | 89 else |
| 90 target.parentNode.removeChild(target); | 90 target.parentNode.removeChild(target); |
| 91 } | 91 } |
| 92 }); | 92 }); |
| 93 } | 93 } |
| 94 } | 94 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 106 { | 106 { |
| 107 setElemhideCSSRules(response.selectors); | 107 setElemhideCSSRules(response.selectors); |
| 108 }); | 108 }); |
| 109 } | 109 } |
| 110 | 110 |
| 111 // In Chrome 18 the document might not be initialized yet | 111 // In Chrome 18 the document might not be initialized yet |
| 112 if (document.documentElement) | 112 if (document.documentElement) |
| 113 init(); | 113 init(); |
| 114 else | 114 else |
| 115 window.setTimeout(init, 0); | 115 window.setTimeout(init, 0); |
| OLD | NEW |