passifox icon indicating copy to clipboard operation
passifox copied to clipboard

chromeIPass search for partial match

Open pmolensky opened this issue 6 years ago • 1 comments

I'm missing an option where the search would return all results where part of the username/title matches the typed characters (*searchstring*). And not only results, starting at position 1 (searchstring*)

I was looking at the code and I found the jQuery.autocomplete (v1.11) widget is used. By default this widget should return any matching entry: https://api.jqueryui.com/1.10/autocomplete/ source: https://api.jqueryui.com/1.10/autocomplete/

But I can't seem to find where the cIPJQ and jQuery differ and create a PR. I tried to compare the unminified sources from cIPJQ and jQuery, but due to all the minified function- and variablenames, it's hard to compare. Or am I looking at the wrong files?

Any suggestions?

pmolensky avatar Jan 10 '19 16:01 pmolensky

UPDATE I found it was not related to jQueryUI. But the function cipAutocomplete.onSource did a search on index equal to zero. Changing the check to greater or equal to zero allows for wildcard searches.

cipAutocomplete.onSource = function (request, callback) {
	var matches = cIPJQ.map( cipAutocomplete.elements, function(tag) {
		if ( tag.label.toUpperCase().indexOf(request.term.toUpperCase()) >= 0 ) {
			return tag;
		}
	});
	callback(matches);
}

Is there a deliberate reason for making the index=0-check? Otherwise I'll make this into a PR. I'll try and make this change conditional and create a setting in the options page to allow for both strict/username only searches or any part of the KeePass entry.

pmolensky avatar Jan 11 '19 00:01 pmolensky