6064:32a8b51c89da | 6066:4f0d9d659cf5 |
---|---|
9 | 9 |
10 from __future__ import unicode_literals | 10 from __future__ import unicode_literals |
11 | 11 |
12 import re | 12 import re |
13 | 13 |
14 from enum import IntFlag | 14 from enum import IntEnum |
15 | 15 |
16 from PyQt5.QtCore import PYQT_VERSION, Qt, QRegExp | 16 from PyQt5.QtCore import PYQT_VERSION, Qt, QRegExp |
17 from PyQt5.QtWebEngineCore import QWebEngineUrlRequestInfo | 17 from PyQt5.QtWebEngineCore import QWebEngineUrlRequestInfo |
18 | 18 |
19 from Globals import qVersionTuple | 19 from Globals import qVersionTuple |
42 domain = domain[domain.find(".") + 1:] | 42 domain = domain[domain.find(".") + 1:] |
43 | 43 |
44 return domain + topLevelDomain | 44 return domain + topLevelDomain |
45 | 45 |
46 | 46 |
47 class AdBlockRuleType(IntFlag): | 47 class AdBlockRuleType(IntEnum): |
48 """ | 48 """ |
49 Class implementing the rule type enum. | 49 Class implementing the rule type enum. |
50 """ | 50 """ |
51 CssRule = 0 | 51 CssRule = 0 |
52 DomainMatchRule = 1 | 52 DomainMatchRule = 1 |
55 StringContainsMatchRule = 4 | 55 StringContainsMatchRule = 4 |
56 MatchAllUrlsRule = 5 | 56 MatchAllUrlsRule = 5 |
57 Invalid = 6 | 57 Invalid = 6 |
58 | 58 |
59 | 59 |
60 class AdBlockRuleOption(IntFlag): | 60 class AdBlockRuleOption(IntEnum): |
61 """ | 61 """ |
62 Class implementing the rule option enum. | 62 Class implementing the rule option enum. |
63 """ | 63 """ |
64 NoOption = 0 | 64 NoOption = 0 |
65 DomainRestrictedOption = 1 | 65 DomainRestrictedOption = 1 |
73 ObjectSubrequestOption = 256 | 73 ObjectSubrequestOption = 256 |
74 PingOption = 512 | 74 PingOption = 512 |
75 MediaOption = 1024 | 75 MediaOption = 1024 |
76 FontOption = 2048 | 76 FontOption = 2048 |
77 OtherOption = 4096 | 77 OtherOption = 4096 |
78 | 78 |
79 # Exception only options | 79 # Exception only options |
80 DocumentOption = 8192 | 80 DocumentOption = 8192 |
81 ElementHideOption = 16384 | 81 ElementHideOption = 16384 |
82 | 82 |
83 | 83 |