mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 762155 - Open keyword URLs without a search term. r=mfinkle
This commit is contained in:
parent
6c3a6b14ac
commit
17e6a345ab
@ -367,12 +367,20 @@ public class AwesomeBar extends GeckoActivity {
|
||||
|
||||
private void openUserEnteredAndFinish(String url) {
|
||||
int index = url.indexOf(' ');
|
||||
if (index != -1) {
|
||||
String keywordUrl = BrowserDB.getUrlForKeyword(mResolver, url.substring(0, index));
|
||||
if (keywordUrl != null && keywordUrl.contains("%s")) {
|
||||
String search = URLEncoder.encode(url.substring(index + 1));
|
||||
url = keywordUrl.replace("%s", search);
|
||||
}
|
||||
String keywordUrl = null;
|
||||
String keywordSearch = null;
|
||||
|
||||
if (index == -1) {
|
||||
keywordUrl = BrowserDB.getUrlForKeyword(mResolver, url);
|
||||
keywordSearch = "";
|
||||
} else {
|
||||
keywordUrl = BrowserDB.getUrlForKeyword(mResolver, url.substring(0, index));
|
||||
keywordSearch = url.substring(index + 1);
|
||||
}
|
||||
|
||||
if (keywordUrl != null) {
|
||||
String search = URLEncoder.encode(keywordSearch);
|
||||
url = keywordUrl.replace("%s", search);
|
||||
}
|
||||
|
||||
Intent resultIntent = new Intent();
|
||||
|
Loading…
Reference in New Issue
Block a user