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

Delta Between Two Patch Sets: lib/contentPolicy.js

Issue 29333097: Isssue 3459 - Map the content type IMAGESET to IMAGE and FETCH to XMLHTTPREQUEST (Closed)
Left Patch Set: Created Dec. 28, 2015, 4:28 p.m.
Right Patch Set: Added missing comment Created Dec. 28, 2015, 4:31 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 27 matching lines...) Expand all
38 var Policy = exports.Policy = 38 var Policy = exports.Policy =
39 { 39 {
40 /** 40 /**
41 * Set of explicitly supported content types 41 * Set of explicitly supported content types
42 * @type Set.<string> 42 * @type Set.<string>
43 */ 43 */
44 contentTypes: new Set([ 44 contentTypes: new Set([
45 "OTHER", "SCRIPT", "IMAGE", "STYLESHEET", "OBJECT", "SUBDOCUMENT", "DOCUMENT ", 45 "OTHER", "SCRIPT", "IMAGE", "STYLESHEET", "OBJECT", "SUBDOCUMENT", "DOCUMENT ",
46 "XMLHTTPREQUEST", "OBJECT_SUBREQUEST", "FONT", "MEDIA", "PING", "ELEMHIDE", 46 "XMLHTTPREQUEST", "OBJECT_SUBREQUEST", "FONT", "MEDIA", "PING", "ELEMHIDE",
47 "POPUP", "GENERICHIDE", "GENERICBLOCK" 47 "POPUP", "GENERICHIDE", "GENERICBLOCK"
48 ]), 48 ]),
Wladimir Palant 2015/12/29 23:19:48 This member becomes unnecessary with your change,
Sebastian Noack 2015/12/30 15:54:58 Note that chrome/content/ui/sidebar.js and chrome/
Wladimir Palant 2016/01/06 12:46:00 You are right but that's not a reason to duplicate
Sebastian Noack 2016/01/06 13:29:50 There you go: https://codereview.adblockplus.org/2
49 49
50 /** 50 /**
51 * 51 * Map of content types reported by Firefox to the respecitve content types
52 * used by Adblock Plus. Other content types are simply mapped to OTHER.
53 * @type Map.<string,string>
52 */ 54 */
53 contentTypesMap: new Map([ 55 contentTypesMap: new Map([
54 // Treat navigator.sendBeacon() the same as <a ping>, 56 // Treat navigator.sendBeacon() the same as <a ping>,
55 // it's essentially the same concept - merely generalized. 57 // it's essentially the same concept - merely generalized.
56 ["BEACON", "PING"], 58 ["BEACON", "PING"],
57 59
58 // Treat <img srcset> and <picture> the same as other images. 60 // Treat <img srcset> and <picture> the same as other images.
59 ["IMAGESET", "IMAGE"], 61 ["IMAGESET", "IMAGE"],
60 62
61 // Treat fetch() the same as XMLHttpRequest, 63 // Treat fetch() the same as XMLHttpRequest,
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 { 415 {
414 // EffectiveTLDService throws on IP addresses, just compare the host name 416 // EffectiveTLDService throws on IP addresses, just compare the host name
415 let host = ""; 417 let host = "";
416 try 418 try
417 { 419 {
418 host = uri.host; 420 host = uri.host;
419 } catch (e) {} 421 } catch (e) {}
420 return host != docDomain; 422 return host != docDomain;
421 } 423 }
422 } 424 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld