| 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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
| 13 * | 13 * |
| 14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
| 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
| 16 */ | 16 */ |
| 17 | 17 |
| 18 "use strict"; | |
| 19 | |
| 20 (function(global) | 18 (function(global) |
| 21 { | 19 { |
| 20 "use strict"; |
| 21 |
| 22 var URLProperties = ["href", "protocol", "hostname", | 22 var URLProperties = ["href", "protocol", "hostname", |
| 23 "host", "pathname", "search"]; | 23 "host", "pathname", "search"]; |
| 24 | 24 |
| 25 // Chrome <35 and Safari 6 used the non-standard name webkitURL | 25 // Chrome <35 and Safari 6 used the non-standard name webkitURL |
| 26 var URL = global.URL || global.webkitURL; | 26 var URL = global.URL || global.webkitURL; |
| 27 | 27 |
| 28 // Chrome <32 didn't implement any of those properties | 28 // Chrome <32 didn't implement any of those properties |
| 29 function hasProperties() | 29 function hasProperties() |
| 30 { | 30 { |
| 31 var dummy = new URL("about:blank"); | 31 var dummy = new URL("about:blank"); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 56 for (var i = 0; i < URLProperties.length; i++) | 56 for (var i = 0; i < URLProperties.length; i++) |
| 57 { | 57 { |
| 58 var prop = URLProperties[i]; | 58 var prop = URLProperties[i]; |
| 59 this[prop] = anchor[prop]; | 59 this[prop] = anchor[prop]; |
| 60 } | 60 } |
| 61 }; | 61 }; |
| 62 } | 62 } |
| 63 | 63 |
| 64 global.URL = URL; | 64 global.URL = URL; |
| 65 })(this); | 65 })(this); |
| OLD | NEW |