on master help sign in
[enh] new plugin to open results on new browser tabs
ab6a760Adam Tauber
searx/plugins/__init__.py+2
@@ -20,6 +20,7 @@ from searx import logger
20logger = logger.getChild('plugins')
20logger = logger.getChild('plugins')
21
21
22from searx.plugins import (https_rewrite,
22from searx.plugins import (https_rewrite,
23+ open_results_on_new_tab,
23 self_info,
24 self_info,
24 search_on_category_select,
25 search_on_category_select,
25 tracker_url_remover)
26 tracker_url_remover)
@@ -72,6 +73,7 @@ class PluginStore():
72
73
73plugins = PluginStore()
74plugins = PluginStore()
74plugins.register(https_rewrite)
75plugins.register(https_rewrite)
76+plugins.register(open_results_on_new_tab)
75plugins.register(self_info)
77plugins.register(self_info)
76plugins.register(search_on_category_select)
78plugins.register(search_on_category_select)
77plugins.register(tracker_url_remover)
79plugins.register(tracker_url_remover)
searx/plugins/open_results_on_new_tab.pynew file+24
@@ -0,0 +1,24 @@
1+'''
2+searx is free software: you can redistribute it and/or modify
3+it under the terms of the GNU Affero General Public License as published by
4+the Free Software Foundation, either version 3 of the License, or
5+(at your option) any later version.
6+
7+searx is distributed in the hope that it will be useful,
8+but WITHOUT ANY WARRANTY; without even the implied warranty of
9+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+GNU Affero General Public License for more details.
11+
12+You should have received a copy of the GNU Affero General Public License
13+along with searx. If not, see < http://www.gnu.org/licenses/ >.
14+
15+(C) 2016 by Adam Tauber, <asciimoo@gmail.com>
16+'''
17+from flask.ext.babel import gettext
18+name = gettext('Open result links on new browser tabs')
19+description = gettext('Results are opened in the same window by default. '
20+ 'This plugin overwrites the default behaviour to open links on new tabs/windows. '
21+ '(JavaScript required)')
22+default_on = False
23+
24+js_dependencies = ('plugins/js/open_results_on_new_tab.js',)
searx/static/plugins/js/open_results_on_new_tab.jsnew file+3
@@ -0,0 +1,3 @@
1+$(document).ready(function() {
2+ $('.result_header > a').attr('target', '_blank');
3+});