| 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 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 yield ["IMAGESET", "IMAGE"]; | 53 yield ["IMAGESET", "IMAGE"]; |
| 54 | 54 |
| 55 // Treat fetch() the same as XMLHttpRequest, | 55 // Treat fetch() the same as XMLHttpRequest, |
| 56 // it's essentially the same - merely a more modern API. | 56 // it's essentially the same - merely a more modern API. |
| 57 yield ["FETCH", "XMLHTTPREQUEST"]; | 57 yield ["FETCH", "XMLHTTPREQUEST"]; |
| 58 | 58 |
| 59 // Everything else is mapped to itself | 59 // Everything else is mapped to itself |
| 60 for (let contentType of ["OTHER", "SCRIPT", "IMAGE", "STYLESHEET", "OBJECT", | 60 for (let contentType of ["OTHER", "SCRIPT", "IMAGE", "STYLESHEET", "OBJECT", |
| 61 "SUBDOCUMENT", "DOCUMENT", "XMLHTTPREQUEST", | 61 "SUBDOCUMENT", "DOCUMENT", "XMLHTTPREQUEST", |
| 62 "OBJECT_SUBREQUEST", "FONT", "MEDIA", "PING", | 62 "OBJECT_SUBREQUEST", "FONT", "MEDIA", "PING", |
| 63 "ELEMHIDE", "POPUP", "GENERICHIDE", "GENERICBLOCK"]
) | 63 "WEBSOCKET", "ELEMHIDE", "POPUP", "GENERICHIDE", |
| 64 "GENERICBLOCK"]) |
| 64 yield [contentType, contentType]; | 65 yield [contentType, contentType]; |
| 65 }()), | 66 }()), |
| 66 | 67 |
| 67 /** | 68 /** |
| 68 * Set of content types that aren't associated with a visual document area | 69 * Set of content types that aren't associated with a visual document area |
| 69 * @type Set.<string> | 70 * @type Set.<string> |
| 70 */ | 71 */ |
| 71 nonVisualTypes: new Set([ | 72 nonVisualTypes: new Set([ |
| 72 "SCRIPT", "STYLESHEET", "XMLHTTPREQUEST", "OBJECT_SUBREQUEST", "FONT", | 73 "SCRIPT", "STYLESHEET", "XMLHTTPREQUEST", "OBJECT_SUBREQUEST", "FONT", |
| 73 "PING", "ELEMHIDE", "POPUP", "GENERICHIDE", "GENERICBLOCK" | 74 "PING", "WEBSOCKET", "ELEMHIDE", "POPUP", "GENERICHIDE", "GENERICBLOCK" |
| 74 ]), | 75 ]), |
| 75 | 76 |
| 76 /** | 77 /** |
| 77 * Map containing all schemes that should be ignored by content policy. | 78 * Map containing all schemes that should be ignored by content policy. |
| 78 * @type Set.<string> | 79 * @type Set.<string> |
| 79 */ | 80 */ |
| 80 whitelistSchemes: new Set(), | 81 whitelistSchemes: new Set(), |
| 81 | 82 |
| 82 /** | 83 /** |
| 83 * Called on module startup, initializes various exported properties. | 84 * Called on module startup, initializes various exported properties. |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 { | 424 { |
| 424 // EffectiveTLDService throws on IP addresses, just compare the host name | 425 // EffectiveTLDService throws on IP addresses, just compare the host name |
| 425 let host = ""; | 426 let host = ""; |
| 426 try | 427 try |
| 427 { | 428 { |
| 428 host = uri.host; | 429 host = uri.host; |
| 429 } catch (e) {} | 430 } catch (e) {} |
| 430 return host != docDomain; | 431 return host != docDomain; |
| 431 } | 432 } |
| 432 } | 433 } |
| OLD | NEW |