OLD | NEW |
1 /* | 1 /* |
2 * This Source Code is subject to the terms of the Mozilla Public License | 2 * This Source Code is subject to the terms of the Mozilla Public License |
3 * version 2.0 (the "License"). You can obtain a copy of the License at | 3 * version 2.0 (the "License"). You can obtain a copy of the License at |
4 * http://mozilla.org/MPL/2.0/. | 4 * http://mozilla.org/MPL/2.0/. |
5 */ | 5 */ |
6 | 6 |
7 // | 7 // |
8 // This mimicks the API of the Matcher module in ABP/Firefox but users Opera's | 8 // This mimicks the API of the Matcher module in ABP/Firefox but users Opera's |
9 // URLFilter API. | 9 // URLFilter API. |
10 // | 10 // |
11 | 11 |
12 (function() | 12 (function() |
13 { | 13 { |
| 14 // Make sure that filters don't apply to extension pages. We shouldn't allow |
| 15 // users to break our options page unintentionally, recovering is very hard |
| 16 // if they do. |
| 17 opera.extension.urlfilter.allow.add("widget://*"); |
| 18 |
14 var WhitelistFilter = null; | 19 var WhitelistFilter = null; |
15 var RegExpFilter = null; | 20 var RegExpFilter = null; |
16 var resourceTypes = [ | 21 var resourceTypes = [ |
17 "DOCUMENT", "FONT", "IMAGE", "MEDIA", "OBJECT", "OBJECT_SUBREQUEST", | 22 "DOCUMENT", "FONT", "IMAGE", "MEDIA", "OBJECT", "OBJECT_SUBREQUEST", |
18 "OTHER", "SCRIPT", "STYLESHEET", "SUBDOCUMENT", "XMLHTTPREQUEST" | 23 "OTHER", "SCRIPT", "STYLESHEET", "SUBDOCUMENT", "XMLHTTPREQUEST" |
19 ]; | 24 ]; |
20 | 25 |
21 require.scopes.matcher = | 26 require.scopes.matcher = |
22 { | 27 { |
23 defaultMatcher: | 28 defaultMatcher: |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 for (var text in this._rules) | 171 for (var text in this._rules) |
167 { | 172 { |
168 var rule = this._rules[text]; | 173 var rule = this._rules[text]; |
169 opera.extension.urlfilter[rule.type].remove(rule.text); | 174 opera.extension.urlfilter[rule.type].remove(rule.text); |
170 } | 175 } |
171 this._rules = {}; | 176 this._rules = {}; |
172 } | 177 } |
173 } | 178 } |
174 }; | 179 }; |
175 })(); | 180 })(); |
OLD | NEW |