From 3de335291e253670ca429fbbf9d5c8d3bc56246a Mon Sep 17 00:00:00 2001 From: gorhill Date: Sun, 26 Apr 2015 15:41:53 -0400 Subject: [PATCH] support using pretty type names --- src/js/devtools.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/js/devtools.js b/src/js/devtools.js index 2e14efe0d..e73fca89d 100644 --- a/src/js/devtools.js +++ b/src/js/devtools.js @@ -117,6 +117,13 @@ var toggleTool = function() { /******************************************************************************/ var evaluateStaticFiltering = (function() { + var uglyTypeNames = { + 'css': 'stylesheet', + 'doc': 'main_frame', + 'frame': 'sub_frame', + 'xhr': 'xmlhttprequest' + }; + var onResultReceived = function(response) { var result = response && response.result.slice(3); uDom('#filteringResult') @@ -134,13 +141,14 @@ var evaluateStaticFiltering = (function() { timer = null; var inputs = uDom('#filterMatcher input'); + var prettyTypeName = inputs.at(2).val().trim(); messager.send({ what: 'evaluateStaticFiltering', tabId: uDom('#pageSelector').val() || '', contextURL: inputs.at(0).val().trim(), requestURL: inputs.at(1).val().trim(), - requestType: inputs.at(2).val().trim(), + requestType: uglyTypeNames[prettyTypeName] || prettyTypeName, }, onResultReceived); };