mirror of https://github.com/gorhill/uBlock.git
support using pretty type names
This commit is contained in:
parent
ef84fd18ba
commit
3de335291e
|
@ -117,6 +117,13 @@ var toggleTool = function() {
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
var evaluateStaticFiltering = (function() {
|
var evaluateStaticFiltering = (function() {
|
||||||
|
var uglyTypeNames = {
|
||||||
|
'css': 'stylesheet',
|
||||||
|
'doc': 'main_frame',
|
||||||
|
'frame': 'sub_frame',
|
||||||
|
'xhr': 'xmlhttprequest'
|
||||||
|
};
|
||||||
|
|
||||||
var onResultReceived = function(response) {
|
var onResultReceived = function(response) {
|
||||||
var result = response && response.result.slice(3);
|
var result = response && response.result.slice(3);
|
||||||
uDom('#filteringResult')
|
uDom('#filteringResult')
|
||||||
|
@ -134,13 +141,14 @@ var evaluateStaticFiltering = (function() {
|
||||||
timer = null;
|
timer = null;
|
||||||
|
|
||||||
var inputs = uDom('#filterMatcher input');
|
var inputs = uDom('#filterMatcher input');
|
||||||
|
var prettyTypeName = inputs.at(2).val().trim();
|
||||||
|
|
||||||
messager.send({
|
messager.send({
|
||||||
what: 'evaluateStaticFiltering',
|
what: 'evaluateStaticFiltering',
|
||||||
tabId: uDom('#pageSelector').val() || '',
|
tabId: uDom('#pageSelector').val() || '',
|
||||||
contextURL: inputs.at(0).val().trim(),
|
contextURL: inputs.at(0).val().trim(),
|
||||||
requestURL: inputs.at(1).val().trim(),
|
requestURL: inputs.at(1).val().trim(),
|
||||||
requestType: inputs.at(2).val().trim(),
|
requestType: uglyTypeNames[prettyTypeName] || prettyTypeName,
|
||||||
}, onResultReceived);
|
}, onResultReceived);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue