aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/webControls
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-05-22 16:28:22 +0530
committerLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-05-22 16:29:43 +0530
commit81ff5d5db80824b08b4f21195d9cefba133ab745 (patch)
treeecd470755afec5d88540a02521109993449ba5c7 /src/features/webControls
parentExpose recipe version in 'Settings' dialog while adding or editing a service.... (diff)
downloadferdium-app-81ff5d5db80824b08b4f21195d9cefba133ab745.tar.gz
ferdium-app-81ff5d5db80824b08b4f21195d9cefba133ab745.tar.zst
ferdium-app-81ff5d5db80824b08b4f21195d9cefba133ab745.zip
Use user-configured search engine.
Diffstat (limited to 'src/features/webControls')
-rw-r--r--src/features/webControls/containers/WebControlsScreen.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/features/webControls/containers/WebControlsScreen.js b/src/features/webControls/containers/WebControlsScreen.js
index 258b15b14..56ba60c37 100644
--- a/src/features/webControls/containers/WebControlsScreen.js
+++ b/src/features/webControls/containers/WebControlsScreen.js
@@ -6,6 +6,7 @@ import { autorun, observable } from 'mobx';
6import WebControls from '../components/WebControls'; 6import WebControls from '../components/WebControls';
7import ServicesStore from '../../../stores/ServicesStore'; 7import ServicesStore from '../../../stores/ServicesStore';
8import Service from '../../../models/Service'; 8import Service from '../../../models/Service';
9import { SEARCH_ENGINE_URLS } from '../../../config';
9 10
10const URL_EVENTS = [ 11const URL_EVENTS = [
11 'load-commit', 12 'load-commit',
@@ -86,7 +87,7 @@ class WebControlsScreen extends Component {
86 if (url.match(/^((?!-))(xn--)?[a-z0-9][a-z0-9-_]{0,61}[a-z0-9]{0,1}\.(xn--)?([a-z0-9\-]{1,61}|[a-z0-9-]{1,30}\.[a-z]{2,})$/)) { 87 if (url.match(/^((?!-))(xn--)?[a-z0-9][a-z0-9-_]{0,61}[a-z0-9]{0,1}\.(xn--)?([a-z0-9\-]{1,61}|[a-z0-9-]{1,30}\.[a-z]{2,})$/)) {
87 url = `http://${url}`; 88 url = `http://${url}`;
88 } else { 89 } else {
89 url = `https://www.google.com/search?query=${url}`; 90 url = SEARCH_ENGINE_URLS[this.settings.app.searchEngine]({ searchTerm: url });
90 } 91 }
91 } 92 }
92 93