| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 261 * Checks whether the location's scheme is blockable. | 261 * Checks whether the location's scheme is blockable. |
| 262 * @param location {nsIURI|String} | 262 * @param location {nsIURI|String} |
| 263 * @return {Boolean} | 263 * @return {Boolean} |
| 264 */ | 264 */ |
| 265 isBlockableScheme: function(location) | 265 isBlockableScheme: function(location) |
| 266 { | 266 { |
| 267 let scheme; | 267 let scheme; |
| 268 if (typeof location == "string") | 268 if (typeof location == "string") |
| 269 { | 269 { |
| 270 let match = /^([\w\-]+):/.exec(location); | 270 let match = /^([\w\-]+):/.exec(location); |
| 271 scheme = match ? match[0] : null; | 271 scheme = match ? match[1] : null; |
|
tschuster
2015/10/31 12:25:11
match[1]
Wladimir Palant
2015/11/01 12:23:37
Done.
| |
| 272 } | 272 } |
| 273 else | 273 else |
| 274 scheme = location.scheme; | 274 scheme = location.scheme; |
| 275 return !this.whitelistSchemes.has(scheme); | 275 return !this.whitelistSchemes.has(scheme); |
| 276 }, | 276 }, |
| 277 | 277 |
| 278 /** | 278 /** |
| 279 * Checks whether a page is whitelisted. | 279 * Checks whether a page is whitelisted. |
| 280 * @param {String} url | 280 * @param {String} url |
| 281 * @param {String} [parentUrl] location of the parent page | 281 * @param {String} [parentUrl] location of the parent page |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 685 if (!wnd || wnd.closed) | 685 if (!wnd || wnd.closed) |
| 686 return; | 686 return; |
| 687 | 687 |
| 688 if (entry.type == "OBJECT") | 688 if (entry.type == "OBJECT") |
| 689 { | 689 { |
| 690 node.removeEventListener("mouseover", objectMouseEventHander, true); | 690 node.removeEventListener("mouseover", objectMouseEventHander, true); |
| 691 node.removeEventListener("mouseout", objectMouseEventHander, true); | 691 node.removeEventListener("mouseout", objectMouseEventHander, true); |
| 692 } | 692 } |
| 693 Policy.processNode(wnd, node, entry.type, entry.location, true); | 693 Policy.processNode(wnd, node, entry.type, entry.location, true); |
| 694 } | 694 } |
| LEFT | RIGHT |