Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: lib/contentPolicy.js

Issue 29353444: Issue 4449 - Use 'websocket' type for WebSocket connections (Closed) Base URL: https://hg.adblockplus.org/adblockplus
Patch Set: Created Sept. 20, 2016, 11:29 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « dependencies ('k') | metadata.gecko » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « dependencies ('k') | metadata.gecko » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld