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-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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 */ | 325 */ |
326 filter: null, | 326 filter: null, |
327 /** | 327 /** |
328 * String representation of the content type, e.g. "subdocument" | 328 * String representation of the content type, e.g. "subdocument" |
329 * @type String | 329 * @type String |
330 */ | 330 */ |
331 get typeDescr() | 331 get typeDescr() |
332 { | 332 { |
333 return this.type; | 333 return this.type; |
334 }, | 334 }, |
335 /** | |
336 * User-visible localized representation of the content type, e.g. "frame" | |
337 * @type String | |
338 */ | |
339 get localizedDescr() | |
340 { | |
341 return require("contentPolicy").Policy.localizedDescr.get(this.type); | |
342 }, | |
343 | 335 |
344 /** | 336 /** |
345 * Attaches this request object to a DOM node. | 337 * Attaches this request object to a DOM node. |
346 */ | 338 */ |
347 attachToNode: function(/**Node*/ node) | 339 attachToNode: function(/**Node*/ node) |
348 { | 340 { |
349 let existingData = nodeData.get(node); | 341 let existingData = nodeData.get(node); |
350 if (typeof existingData == "undefined") | 342 if (typeof existingData == "undefined") |
351 { | 343 { |
352 existingData = {}; | 344 existingData = {}; |
353 nodeData.set(node, existingData); | 345 nodeData.set(node, existingData); |
354 } | 346 } |
355 | 347 |
356 // Add this request to the node data | 348 // Add this request to the node data |
357 existingData[this.type + " " + this.location] = this; | 349 existingData[this.type + " " + this.location] = this; |
358 } | 350 } |
359 }; | 351 }; |
OLD | NEW |