iOS web browser with a focus on security and privacy
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

WVC: add setting to disable stop-at-dot for live search

This makes it possible to have live search results for queries with
dots in them, but since this may be a URL (without a scheme) and
private, leave the default as it was before and stop searching when
the first dot is entered.

+25 -6
+22 -4
Endless/InAppSettings.bundle/Root.inApp.plist
··· 43 43 <false/> 44 44 </dict> 45 45 <dict> 46 + <key>Title</key> 47 + <string>Custom home page</string> 48 + <key>Key</key> 49 + <string>homepage</string> 50 + <key>Type</key> 51 + <string>PSTextFieldSpecifier</string> 52 + <key>DefaultValue</key> 53 + <string></string> 54 + </dict> 55 + <dict> 56 + <key>Title</key> 57 + <string>Search Engine</string> 58 + <key>Type</key> 59 + <string>PSGroupSpecifier</string> 60 + <key>FooterText</key> 61 + <string>When disabled, all text entered in search bar will be sent to the search engine unless it starts with &quot;http&quot;</string> 62 + </dict> 63 + <dict> 46 64 <key>DefaultValue</key> 47 65 <string>DuckDuckGo</string> 48 66 <key>Values</key> ··· 76 94 </dict> 77 95 <dict> 78 96 <key>Title</key> 79 - <string>Custom home page</string> 97 + <string>Stop auto-complete at first dot</string> 80 98 <key>Key</key> 81 - <string>homepage</string> 99 + <string>search_engine_stop_dot</string> 82 100 <key>Type</key> 83 - <string>PSTextFieldSpecifier</string> 101 + <string>PSToggleSwitchSpecifier</string> 84 102 <key>DefaultValue</key> 85 - <string></string> 103 + <true/> 86 104 </dict> 87 105 <dict> 88 106 <key>Title</key>
+3 -2
Endless/WebViewController.m
··· 902 902 903 903 - (void)textFieldDidChange:(UITextField *)textField 904 904 { 905 + NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; 906 + 905 907 if (textField != urlField) 906 908 return; 907 909 908 910 /* if it looks like we're typing a url, stop searching */ 909 - if ([urlField text] == nil || [[urlField text] isEqualToString:@""] || [[urlField text] hasPrefix:@"http:"] || [[urlField text] hasPrefix:@"https:"] || [[urlField text] containsString:@"."]) { 911 + if ([urlField text] == nil || [[urlField text] isEqualToString:@""] || [[urlField text] hasPrefix:@"http:"] || [[urlField text] hasPrefix:@"https:"] || ([[urlField text] containsString:@"."] && [userDefaults boolForKey:@"search_engine_stop_dot"])) { 910 912 [self hideSearchResults]; 911 913 [self showBookmarksForEditing:NO]; 912 914 return; 913 915 } 914 916 915 - NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; 916 917 if (![userDefaults boolForKey:@"search_engine_live"]) 917 918 return; 918 919