Skip to content

Commit

Permalink
Support advanced syntax in SERP (#4009)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/414730916066338/1206153302008458/f

### Description
This PR adds support for advanced syntax in SERP

### Steps to test this PR

- [x] In the url bar type filetype:pdf, search should return different
pdfs files
- [x] In the url bar type inurl:cat, search should return urls which
contain the word cat
- [x] In the url bar type intitle:cat, search should return websites
which title contains the word cat
- [x] None of the above should throw an Unable to open this type of link
error in a toast
  • Loading branch information
marcosholgado authored Dec 17, 2023
1 parent fa7d6b7 commit 6c6c54d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class SpecialUrlDetectorImpl(
SMSTO_SCHEME -> buildSmsTo(uriString)
HTTP_SCHEME, HTTPS_SCHEME, DATA_SCHEME -> processUrl(initiatingUrl, uriString)
JAVASCRIPT_SCHEME, ABOUT_SCHEME, FILE_SCHEME, SITE_SCHEME -> UrlType.SearchQuery(uriString)
null -> UrlType.SearchQuery(uriString)
null, FILETYPE_SCHEME, IN_TITLE_SCHEME, IN_URL_SCHEME -> UrlType.SearchQuery(uriString)
else -> checkForIntent(scheme, uriString)
}
}
Expand Down Expand Up @@ -216,6 +216,9 @@ class SpecialUrlDetectorImpl(
private const val FILE_SCHEME = "file"
private const val SITE_SCHEME = "site"
private const val EXTRA_FALLBACK_URL = "browser_fallback_url"
private const val FILETYPE_SCHEME = "filetype"
private const val IN_TITLE_SCHEME = "intitle"
private const val IN_URL_SCHEME = "inurl"
const val SMS_MAX_LENGTH = 400
const val PHONE_MAX_LENGTH = 20
const val EMAIL_MAX_LENGTH = 1000
Expand Down

0 comments on commit 6c6c54d

Please sign in to comment.