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 16 matching lines...) Expand all Loading... |
27 let {Utils} = require("utils"); | 27 let {Utils} = require("utils"); |
28 let {Prefs} = require("prefs"); | 28 let {Prefs} = require("prefs"); |
29 let {FilterStorage} = require("filterStorage"); | 29 let {FilterStorage} = require("filterStorage"); |
30 let {BlockingFilter, WhitelistFilter, RegExpFilter} = require("filterClasses"); | 30 let {BlockingFilter, WhitelistFilter, RegExpFilter} = require("filterClasses"); |
31 let {defaultMatcher} = require("matcher"); | 31 let {defaultMatcher} = require("matcher"); |
32 let {objectMouseEventHander} = require("objectTabs"); | 32 let {objectMouseEventHander} = require("objectTabs"); |
33 let {ElemHide} = require("elemHide"); | 33 let {ElemHide} = require("elemHide"); |
34 | 34 |
35 /** | 35 /** |
36 * Randomly generated class name, to be applied to collapsed nodes. | 36 * Randomly generated class name, to be applied to collapsed nodes. |
| 37 * @type string |
37 */ | 38 */ |
38 let collapsedClass = ""; | 39 let collapsedClass = ""; |
39 | 40 |
40 /** | 41 /** |
41 * Public policy checking functions and auxiliary objects | 42 * Public policy checking functions and auxiliary objects |
42 * @class | 43 * @class |
43 */ | 44 */ |
44 var Policy = exports.Policy = | 45 var Policy = exports.Policy = |
45 { | 46 { |
46 /** | 47 /** |
47 * Set of explicitly supported content types | 48 * Set of explicitly supported content types |
48 * @type Set | 49 * @type Set.<string> |
49 */ | 50 */ |
50 contentTypes: new Set([ | 51 contentTypes: new Set([ |
51 "OTHER", "SCRIPT", "IMAGE", "STYLESHEET", "OBJECT", "SUBDOCUMENT", "DOCUMENT
", | 52 "OTHER", "SCRIPT", "IMAGE", "STYLESHEET", "OBJECT", "SUBDOCUMENT", "DOCUMENT
", |
52 "XMLHTTPREQUEST", "OBJECT_SUBREQUEST", "FONT", "MEDIA", "ELEMHIDE", "POPUP", | 53 "XMLHTTPREQUEST", "OBJECT_SUBREQUEST", "FONT", "MEDIA", "ELEMHIDE", "POPUP", |
53 "GENERICHIDE", "GENERICBLOCK" | 54 "GENERICHIDE", "GENERICBLOCK" |
54 ]), | 55 ]), |
55 | 56 |
56 /** | 57 /** |
57 * Set of content types that aren't associated with a visual document area | 58 * Set of content types that aren't associated with a visual document area |
58 * @type Set | 59 * @type Set.<string> |
59 */ | 60 */ |
60 nonVisualTypes: new Set([ | 61 nonVisualTypes: new Set([ |
61 "SCRIPT", "STYLESHEET", "XMLHTTPREQUEST", "OBJECT_SUBREQUEST", "FONT", | 62 "SCRIPT", "STYLESHEET", "XMLHTTPREQUEST", "OBJECT_SUBREQUEST", "FONT", |
62 "ELEMHIDE", "POPUP", "GENERICHIDE", "GENERICBLOCK" | 63 "ELEMHIDE", "POPUP", "GENERICHIDE", "GENERICBLOCK" |
63 ]), | 64 ]), |
64 | 65 |
65 /** | 66 /** |
66 * Map containing all schemes that should be ignored by content policy. | 67 * Map containing all schemes that should be ignored by content policy. |
67 * @type Set | 68 * @type Set.<string> |
68 */ | 69 */ |
69 whitelistSchemes: new Set(), | 70 whitelistSchemes: new Set(), |
70 | 71 |
71 /** | 72 /** |
72 * Called on module startup, initializes various exported properties. | 73 * Called on module startup, initializes various exported properties. |
73 */ | 74 */ |
74 init: function() | 75 init: function() |
75 { | 76 { |
76 // whitelisted URL schemes | 77 // whitelisted URL schemes |
77 for (let scheme of Prefs.whitelistschemes.toLowerCase().split(" ")) | 78 for (let scheme of Prefs.whitelistschemes.toLowerCase().split(" ")) |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 if (!wnd || wnd.closed) | 411 if (!wnd || wnd.closed) |
411 return; | 412 return; |
412 | 413 |
413 if (entry.type == "OBJECT") | 414 if (entry.type == "OBJECT") |
414 { | 415 { |
415 node.removeEventListener("mouseover", objectMouseEventHander, true); | 416 node.removeEventListener("mouseover", objectMouseEventHander, true); |
416 node.removeEventListener("mouseout", objectMouseEventHander, true); | 417 node.removeEventListener("mouseout", objectMouseEventHander, true); |
417 } | 418 } |
418 Policy.processNode(wnd, node, entry.type, entry.location, true); | 419 Policy.processNode(wnd, node, entry.type, entry.location, true); |
419 } | 420 } |
OLD | NEW |