Skip to content

Commit

Permalink
fix: update default search engine to google search
Browse files Browse the repository at this point in the history
  • Loading branch information
viphan007 committed Nov 4, 2024
1 parent 7cb5913 commit f4173c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Autocomplete/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class Autocomplete extends Component {
handleSubmit = (event) => {
event.preventDefault();
this.trackEventSearchUsed();
const searchEngine = window.__mmSearchEngine || 'DuckDuckGo';
const searchEngine = window.__mmSearchEngine;
const sanitizedInput = onUrlSubmit(this.state.value, searchEngine);
window.location.href = sanitizedInput;
}
Expand Down
2 changes: 1 addition & 1 deletion src/util/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import URL from 'url-parse';
* @param {string} defaultProtocol - Protocol string to append to URLs that have none
* @returns {string} - String corresponding to sanitized input depending if it's a search or url
*/
export default function onUrlSubmit(input, searchEngine = 'DuckDuckGo', defaultProtocol = 'https://') {
export default function onUrlSubmit(input, searchEngine, defaultProtocol = 'https://') {
//Check if it's a url or a keyword
const res = input.match(/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!&',;=.+]+$/g);
if (res === null) {
Expand Down

0 comments on commit f4173c6

Please sign in to comment.