support using pretty type names

This commit is contained in:
gorhill 2015-04-26 15:41:53 -04:00
parent ef84fd18ba
commit 3de335291e
1 changed files with 9 additions and 1 deletions

View File

@ -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);
}; };