Skip to content

Commit 2cb8ddb

Browse files
committed
1 parent a8382e8 commit 2cb8ddb

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

src/js/logger-ui.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -701,16 +701,22 @@ var netFilteringManager = (function() {
701701
};
702702

703703
var parseStaticInputs = function() {
704-
var filter = '';
705-
var options = [];
706-
var block = selectValue('select.static.action') === '';
704+
var filter = '',
705+
options = [],
706+
block = selectValue('select.static.action') === '';
707707
if ( !block ) {
708708
filter = '@@';
709709
}
710710
var value = selectValue('select.static.url');
711711
if ( value !== '' ) {
712-
filter += '||' + value;
712+
if ( value.slice(-1) === '/' ) {
713+
value += '*';
714+
} else if ( /[/?]/.test(value) === false ) {
715+
value += '^';
716+
}
717+
value = '||' + value;
713718
}
719+
filter += value;
714720
value = selectValue('select.static.type');
715721
if ( value !== '' ) {
716722
options.push(uglyTypeFromSelector('static'));
@@ -974,7 +980,7 @@ var netFilteringManager = (function() {
974980
if ( pos === -1 ) {
975981
pos = path.length;
976982
}
977-
urls.unshift(rootURL + path.slice(0, pos));
983+
urls.unshift(rootURL + path.slice(0, pos + 1));
978984
}
979985
var query = matches[4] || '';
980986
if ( query !== '') {
@@ -1042,7 +1048,7 @@ var netFilteringManager = (function() {
10421048
var rePlaceholder = /\{\{[^}]+?\}\}/g;
10431049
var nodes = [];
10441050
var match, pos = 0;
1045-
var select, option, i, value;
1051+
var select, option, n, i, value;
10461052
for (;;) {
10471053
match = rePlaceholder.exec(template);
10481054
if ( match === null ) {
@@ -1088,8 +1094,8 @@ var netFilteringManager = (function() {
10881094
case '{{url}}':
10891095
select = document.createElement('select');
10901096
select.className = 'static url';
1091-
for ( i = 0; i < targetURLs.length; i++ ) {
1092-
value = targetURLs[i].replace(/^[a-z]+:\/\//, '');
1097+
for ( i = 0, n = targetURLs.length; i < n; i++ ) {
1098+
value = targetURLs[i].replace(/^[a-z-]+:\/\//, '');
10931099
option = document.createElement('option');
10941100
option.setAttribute('value', value);
10951101
option.textContent = shortenLongString(value, 128);

0 commit comments

Comments
 (0)