| Index: chrome/content/ui/composer.js |
| =================================================================== |
| --- a/chrome/content/ui/composer.js |
| +++ b/chrome/content/ui/composer.js |
| @@ -131,17 +131,17 @@ function init() |
| if (docDomain) |
| E("domainRestriction").value = docDomain; |
| E("thirdParty").hidden = !thirdParty; |
| E("firstParty").hidden = thirdParty; |
| let typeGroup = E("typeGroup"); |
| let defaultTypes = RegExpFilter.prototype.contentType & ~RegExpFilter.typeMap.DOCUMENT; |
| - let isDefaultType = (RegExpFilter.typeMap[item.typeDescr] & defaultTypes) != 0; |
| + let isDefaultType = (RegExpFilter.typeMap[item.type] & defaultTypes) != 0; |
| for (let [type, label] of types) |
| { |
| if (type == "ELEMHIDE") |
| continue; |
| let typeNode = document.createElement("checkbox"); |
| typeNode.setAttribute("value", type.toLowerCase().replace(/\_/g, "-")); |
| typeNode.setAttribute("label", label); |
| @@ -248,34 +248,34 @@ function updateFilter() |
| { |
| options.sort((a, b) => a[0] - b[0]); |
| filter += "$" + options.map(o => o[1]).join(","); |
| } |
| } |
| else |
| { |
| let defaultTypes = RegExpFilter.prototype.contentType & ~RegExpFilter.typeMap.DOCUMENT; |
| - let isDefaultType = (RegExpFilter.typeMap[item.typeDescr] & defaultTypes) != 0; |
| + let isDefaultType = (RegExpFilter.typeMap[item.type] & defaultTypes) != 0; |
| if (!isDefaultType) |
| - filter += "$" + item.typeDescr.toLowerCase().replace(/\_/g, "-"); |
| + filter += "$" + item.type.toLowerCase().replace(/\_/g, "-"); |
| } |
| filter = Filter.normalize(filter); |
| E("regexpWarning").hidden = !Filter.regexpRegExp.test(filter); |
| let isSlow = false; |
| let compiledFilter = Filter.fromText(filter); |
| if (E("regexpWarning").hidden) |
| { |
| if (compiledFilter instanceof RegExpFilter && defaultMatcher.isSlowFilter(compiledFilter)) |
| isSlow = true; |
| } |
| E("shortpatternWarning").hidden = !isSlow; |
| - E("matchWarning").hidden = compiledFilter instanceof RegExpFilter && compiledFilter.matches(item.location, RegExpFilter.typeMap[item.typeDescr], item.docDomain, item.thirdParty); |
| + E("matchWarning").hidden = compiledFilter instanceof RegExpFilter && compiledFilter.matches(item.location, RegExpFilter.typeMap[item.type], item.docDomain, item.thirdParty); |
| E("filter").value = filter; |
| } |
| function generateLinkText(element, replacement) |
| { |
| let template = element.getAttribute("textTemplate"); |
| if (typeof replacement != "undefined") |
| @@ -304,17 +304,17 @@ function updatePatternSelection() |
| else |
| { |
| E("anchorStart").checked = true; |
| E("anchorEnd").checked = false; |
| } |
| function testFilter(/**String*/ filter) /**Boolean*/ |
| { |
| - return RegExpFilter.fromText(filter + "$" + item.typeDescr).matches(item.location, RegExpFilter.typeMap[item.typeDescr], item.docDomain, item.thirdParty); |
| + return RegExpFilter.fromText(filter + "$" + item.type).matches(item.location, RegExpFilter.typeMap[item.type], item.docDomain, item.thirdParty); |
| } |
| let anchorStartCheckbox = E("anchorStart"); |
| if (!/^\*/.test(pattern) && testFilter("||" + pattern)) |
| { |
| disableElement(anchorStartCheckbox, false, "checked", false); |
| [anchorStartCheckbox.label, anchorStartCheckbox.accessKey] = Utils.splitLabel(anchorStartCheckbox.getAttribute("labelFlexible")); |
| anchorStartCheckbox.flexibleAnchor = true; |