Skip to content
Snippets Groups Projects

Merge buster-security from Apertis/v2022dev1

Closed Andrew Lee requested to merge apertis/v2022dev1 into apertis/v2021
139 files
+ 3483
2252
Compare changes
  • Side-by-side
  • Inline
Files
139
@@ -105,14 +105,18 @@ let WebsiteFilter = {
shouldLoad(contentLocation, loadInfo, mimeTypeGuess) {
let contentType = loadInfo.externalContentPolicyType;
let url = contentLocation.spec;
if (contentLocation.scheme == "view-source") {
url = contentLocation.pathQueryRef;
}
if (
contentType == Ci.nsIContentPolicy.TYPE_DOCUMENT ||
contentType == Ci.nsIContentPolicy.TYPE_SUBDOCUMENT
) {
if (this._blockPatterns.matches(contentLocation.spec.toLowerCase())) {
if (this._blockPatterns.matches(url.toLowerCase())) {
if (
!this._exceptionsPatterns ||
!this._exceptionsPatterns.matches(contentLocation.spec.toLowerCase())
!this._exceptionsPatterns.matches(url.toLowerCase())
) {
return Ci.nsIContentPolicy.REJECT_POLICY;
}
Loading