├── duckduckgo.safariextension
├── css
│ ├── noatb.css
│ └── nopopup.css
├── Icon-32.png
├── Icon-48.png
├── Icon-64.png
├── img
│ ├── ddg-icon.png
│ ├── ddg-icon@2x.png
│ └── ddg-icon@3x.png
├── js
│ ├── contextmenu.js
│ ├── nopopup.js
│ ├── oninstall.js
│ ├── popup.js
│ └── jquery.js
├── Settings.plist
├── html
│ ├── global.html
│ └── popup.html
└── Info.plist
├── duckduckgo.safariextz
├── README.md
├── duckduckgo.plist
└── LICENSE
/duckduckgo.safariextension/css/noatb.css:
--------------------------------------------------------------------------------
1 | .ddg-extension-hide {
2 | display: none !important;
3 | }
4 |
--------------------------------------------------------------------------------
/duckduckgo.safariextz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/duckduckgo/safari-zeroclickinfo/HEAD/duckduckgo.safariextz
--------------------------------------------------------------------------------
/duckduckgo.safariextension/css/nopopup.css:
--------------------------------------------------------------------------------
1 | .gb_g[aria-label=promo] .gb_g {
2 | display: none !important;
3 | }
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | safari-zeroclickinfo
2 | ====================
3 |
4 | Safari extension using the DuckDuckGo Zero-click Info API
5 |
--------------------------------------------------------------------------------
/duckduckgo.safariextension/Icon-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/duckduckgo/safari-zeroclickinfo/HEAD/duckduckgo.safariextension/Icon-32.png
--------------------------------------------------------------------------------
/duckduckgo.safariextension/Icon-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/duckduckgo/safari-zeroclickinfo/HEAD/duckduckgo.safariextension/Icon-48.png
--------------------------------------------------------------------------------
/duckduckgo.safariextension/Icon-64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/duckduckgo/safari-zeroclickinfo/HEAD/duckduckgo.safariextension/Icon-64.png
--------------------------------------------------------------------------------
/duckduckgo.safariextension/img/ddg-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/duckduckgo/safari-zeroclickinfo/HEAD/duckduckgo.safariextension/img/ddg-icon.png
--------------------------------------------------------------------------------
/duckduckgo.safariextension/img/ddg-icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/duckduckgo/safari-zeroclickinfo/HEAD/duckduckgo.safariextension/img/ddg-icon@2x.png
--------------------------------------------------------------------------------
/duckduckgo.safariextension/img/ddg-icon@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/duckduckgo/safari-zeroclickinfo/HEAD/duckduckgo.safariextension/img/ddg-icon@3x.png
--------------------------------------------------------------------------------
/duckduckgo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Extension Updates
6 |
7 |
8 | CFBundleIdentifier
9 | com.duckduckgo.safari
10 | Developer Identifier
11 | HKE973VLUW
12 | CFBundleVersion
13 | 38
14 | CFBundleShortVersionString
15 | 1.8.0
16 | URL
17 | http://duckduckgo.com/extensions/duckduckgo.safariextz
18 | Update From Gallery
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | This license does not apply to any DuckDuckGo logos or marks that may be contained
2 | in this repo. DuckDuckGo logos and marks are licensed separately under the CCBY-NC-ND 4.0
3 | license (https://creativecommons.org/licenses/by-nc-nd/4.0/), and official up-to-date
4 | versions can be downloaded from https://duckduckgo.com/press.
5 |
6 | Copyright 2010 Duck Duck Go, Inc.
7 |
8 | Licensed under the Apache License, Version 2.0 (the "License");
9 | you may not use this file except in compliance with the License.
10 | You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing, software
15 | distributed under the License is distributed on an "AS IS" BASIS,
16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
17 |
--------------------------------------------------------------------------------
/duckduckgo.safariextension/js/contextmenu.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DuckDuckGo, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | document.addEventListener("contextmenu", ddgHandler, false);
18 |
19 | function ddgHandler(ddgEvent) {
20 | var sel = '';
21 | sel = window.parent.getSelection()+'';
22 | sel = sel.replace(/^\s+|\s+$/g,"");
23 | safari.self.tab.setContextMenuEventUserInfo(ddgEvent, sel);
24 | }
25 |
--------------------------------------------------------------------------------
/duckduckgo.safariextension/js/nopopup.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (C) 2016 DuckDuckGo, Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 |
16 | */
17 | "use strict";
18 |
19 | document.addEventListener('DOMContentLoaded', function() {
20 | safari.self.tab.dispatchMessage("get_settings");
21 |
22 | safari.self.addEventListener("message", function(event) {
23 | if (event.name === "set_settings") {
24 |
25 | var options = event.message;
26 |
27 | if (options.nopopups === false) {
28 | return
29 | }
30 |
31 | var style = document.createElement('style');
32 | style.appendChild(document.createTextNode('.gb_g[aria-label=promo] { display: none !important; }'));
33 | document.head.appendChild(style);
34 | }
35 | });
36 | });
37 |
--------------------------------------------------------------------------------
/duckduckgo.safariextension/js/oninstall.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (C) 2016 DuckDuckGo, Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 |
16 | */
17 | "use strict";
18 |
19 | if (window.top === window) {
20 |
21 | safari.self.tab.dispatchMessage("check_atb_set");
22 | safari.self.tab.dispatchMessage("get_atb_param");
23 |
24 | safari.self.addEventListener("message", function(event) {
25 | if (event.name === "get_atb") {
26 | setTimeout(function() {
27 | var atbParam = document.querySelector('html').getAttribute('data-atb');
28 | if (atbParam) {
29 | safari.self.tab.dispatchMessage("set_atb", atbParam);
30 | }
31 | }, 500);
32 | }
33 |
34 | if (event.name === "atb_param") {
35 | var atbParam = event.message;
36 | var input = document.createElement('input');
37 | input.type = 'hidden';
38 | input.name = 'atb';
39 | input.value = atbParam;
40 | var form = document.querySelector('#search_form_homepage');
41 | if (form) {
42 | form.appendChild(input);
43 | }
44 | }
45 | });
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/duckduckgo.safariextension/Settings.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | DefaultValue
7 |
8 | Key
9 | ddg_locationbar
10 | Title
11 | DuckDuckGo as default (in Smart Search field)
12 | Titles
13 |
14 | Yes
15 | No
16 | Only for queries with '!bang' commands or beginning with '\'
17 |
18 | Type
19 | RadioButtons
20 | Values
21 |
22 |
23 |
24 | bang
25 |
26 |
27 |
28 | DefaultValue
29 |
30 | Key
31 | remember_last_search
32 | Title
33 | Remember last search in the popup
34 | Type
35 | CheckBox
36 |
37 |
38 | DefaultValue
39 |
40 | Key
41 | rightclick
42 | Title
43 | Show right click instant answers (when you highlight words)
44 | Type
45 | CheckBox
46 |
47 |
48 | DefaultValue
49 |
50 | Key
51 | nopopups
52 | Title
53 | Remove annoying Google marketing popups
54 | Type
55 | CheckBox
56 |
57 |
58 | DefaultValue
59 |
60 | Key
61 | dev
62 | Title
63 | Show debug information
64 | Type
65 | CheckBox
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/duckduckgo.safariextension/html/global.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | DuckDuckGo
6 |
265 |
266 |
267 |
--------------------------------------------------------------------------------
/duckduckgo.safariextension/js/popup.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (C) 2012, 2014 DuckDuckGo, Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 |
16 | */
17 |
18 | var ICON_MAXIMIZE = "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDIwIDIwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PGcgaWQ9Im1heGltaXplIj48cGF0aCBzdHlsZT0iZmlsbC1ydWxlOmV2ZW5vZGQ7Y2xpcC1ydWxlOmV2ZW5vZGQ7ZmlsbDojQUFBQUFBOyIgZD0iTTEwLDBjNS41LDAsMTAsNC41LDEwLDEwYzAsNS41LTQuNSwx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E0LDE2SDJjLTEuMSwwLTItMC45LTItMlYyYzAtMS4xLDAuOS0yLDItMmgxMmMxLjEsMCwyLDAuOSwyLDJ2MTJDMTYsMTUuMSwxNS4xLDE2LDE0LDE2eiIvPjxwb2x5Z29uIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBmaWxsPSIjRkZGRkZGIiBwb2ludHM9IjEyLDcgOSw3IDksNCA3LDQgNyw3IDQsNyA0LDkgNyw5IDcsMTIgOSwxMiA5LDkgMTIsOSAiLz48L3N2Zz4=";
25 |
26 | if (localStorage['advanced_options'] == undefined){
27 | localStorage['advanced_options'] = 'true';
28 | }
29 |
30 | if (localStorage['locationbar'] == undefined){
31 | localStorage['locationbar'] = 'true';
32 | }
33 |
34 |
35 |
36 | if (localStorage['advanced_options'] !== 'true') {
37 | document.getElementById('icon_advanced').src = ICON_MINIMIZE;
38 | document.getElementById('advanced').style.display = 'none';
39 | document.getElementById('icon_advanced').className = 'minimized';
40 | safari.extension.popovers[0].height = 60;
41 | }
42 |
43 |
44 | window.addEventListener("load", function() {
45 | settings_check();
46 | defaults_check();
47 |
48 | if (localStorage['last_search'] != '' && safari.extension.settings.remember_last_search) {
49 | document.getElementById('search_form_input_homepage').value = localStorage['last_search'];
50 | document.getElementById("search_form_input_clear").style.display = 'inline-block';
51 | } else {
52 | search_input_clear();
53 | }
54 |
55 | // handling hover behaviour of images
56 | var images = document.querySelectorAll('li img');
57 | for(var i = 0; i < images.length; i++) {
58 | images[i].onmouseover = function() {
59 | this.src = BTN_HOVER;
60 | }
61 |
62 | images[i].onmouseout = function() {
63 | this.src = BTN_NORMAL;
64 | }
65 | }
66 |
67 | document.getElementById("search_form_input_homepage").onkeydown = function(){
68 | document.getElementById("search_form_input_clear").style.display = 'inline-block';
69 | document.getElementById("search_button_homepage").className = 'selected';
70 | this.style.color = '#000000';
71 | };
72 | document.getElementById("search_form_input_homepage").onkeyup = function(){
73 | if (this.value == '') {
74 | this.style.color = '#999999';
75 | search_input_clear();
76 | }
77 | };
78 |
79 | document.getElementById('adv_ducky').onclick = ducky_check;
80 | document.getElementById('adv_locationbar').onclick = locationbar_check;
81 | document.getElementById('adv_remember_last_search').onclick = remember_last_search_check;
82 |
83 |
84 |
85 | document.getElementById('bang_w').onclick = function(){
86 | add_bang('!w');
87 | }
88 | document.getElementById('bang_bi').onclick = function(){
89 | add_bang('!bi');
90 | }
91 | document.getElementById('bang_a').onclick = function(){
92 | add_bang('!a');
93 | }
94 | document.getElementById('bang_gi').onclick = function(){
95 | add_bang('!gi');
96 | }
97 | document.getElementById('bang_n').onclick = function(){
98 | add_bang('!n');
99 | }
100 | document.getElementById('bang_yt').onclick = function(){
101 | add_bang('!yt');
102 | }
103 | document.getElementById('bang_m').onclick = function(){
104 | add_bang('!m');
105 | }
106 |
107 | document.getElementById("search_form_input_clear").onclick = function(){
108 | search_input_clear();
109 | };
110 |
111 | document.getElementById('search_form_input_homepage').focus();
112 | // https://developer.mozilla.org/en-US/docs/Web/API/Input.select
113 | document.getElementById('search_form_input_homepage').setSelectionRange(0, 9999);
114 | });
115 |
116 |
117 | function search(){
118 | var input = document.getElementById("search_form_input_homepage").value;
119 |
120 | if (safari.extension.settings.remember_last_search) {
121 | localStorage['last_search'] = input;
122 | } else {
123 | search_input_clear();
124 | }
125 |
126 | if (safari.extension.settings.dev) console.log('remember_last_search:', safari.extension.settings.remember_last_search);
127 |
128 | if (document.getElementById('adv_ducky').checked === true) {
129 | input = "\\" + input;
130 | }
131 |
132 | var special = '&bext=msp' + '&atb=' + localStorage['atb'];
133 |
134 | if (safari.application.activeBrowserWindow.activeTab.url === undefined ||
135 | safari.application.activeBrowserWindow.activeTab.url === '') {
136 | safari.application.activeBrowserWindow.activeTab.url = "https://duckduckgo.com/?q="+encodeURIComponent(input)+special;
137 | } else {
138 | openTab("https://duckduckgo.com/?q="+encodeURIComponent(input)+special);
139 | }
140 |
141 | var search = document.getElementById("search_form_input_homepage");
142 |
143 | safari.extension.popovers[0].hide();
144 | return false;
145 | }
146 |
147 | document.getElementById('icon_advanced').onclick = function(){
148 | if (this.className == 'minimized') {
149 | this.src = ICON_MINIMIZE;
150 |
151 | document.getElementById('advanced').style.display = 'block';
152 | this.className = 'maximized';
153 | safari.extension.popovers[0].height = 170;
154 | } else {
155 | this.src = ICON_MAXIMIZE;
156 |
157 | document.getElementById('advanced').style.display = 'none';
158 | this.className = 'minimized';
159 | safari.extension.popovers[0].height = 60;
160 | }
161 | localStorage['advanced_options'] = (document.getElementById('advanced').style.display === 'block');
162 | document.getElementById('search_form_input_homepage').focus();
163 | }
164 |
165 | function add_bang(bang) {
166 | var inp = document.getElementById('search_form_input_homepage');
167 |
168 | var bang_regex = /\!\w+/;
169 |
170 | document.getElementById("search_form_input_clear").style.display= 'inline-block';
171 | document.getElementById("search_button_homepage").className = 'selected';
172 |
173 | if (inp.value === '') {
174 | inp.style.color = '#000';
175 | inp.value = bang + ' ';
176 | inp.focus();
177 | } else {
178 | var found_bangs = bang_regex.exec(inp.value);
179 | if (found_bangs !== null) {
180 | inp.value = inp.value.replace(found_bangs[0], bang);
181 | inp.focus();
182 | } else {
183 | inp.value += bang;
184 | search();
185 | }
186 | }
187 | }
188 |
189 | function ducky_check(){
190 | localStorage['ducky'] = document.getElementById('adv_ducky').checked;
191 | }
192 |
193 |
194 | function remember_last_search_check(){
195 | localStorage['remember_last_search'] = document.getElementById('adv_remember_last_search').checked;
196 | safari.extension.settings.remember_last_search =
197 | ( document.getElementById('adv_remember_last_search').checked === true );
198 | }
199 |
200 | function locationbar_check(){
201 | localStorage['locationbar'] = document.getElementById('adv_locationbar').checked;
202 | safari.extension.settings.ddg_locationbar =
203 | ( document.getElementById('adv_locationbar').checked === true );
204 |
205 | }
206 |
207 | function settings_check() {
208 |
209 | document.getElementById('adv_locationbar').checked =
210 | (safari.extension.settings.ddg_locationbar === true);
211 | if (safari.extension.settings.ddg_locationbar === true)
212 | localStorage['locationbar'] = 'true';
213 | else
214 | localStorage['locationbar'] = 'false';
215 |
216 |
217 | document.getElementById('adv_remember_last_search').checked = safari.extension.settings.remember_last_search;
218 |
219 | if (safari.extension.settings.remember_last_search)
220 | localStorage['remember_last_search'] = 'true';
221 | else
222 | localStorage['remember_last_search'] = 'false';
223 |
224 | if (!safari.extension.settings.remember_last_search)
225 | localStorage['last_search'] = '';
226 |
227 | }
228 |
229 | function defaults_check(){
230 | if (localStorage['ducky'] === 'true') {
231 | document.getElementById('adv_ducky').checked = true;
232 | }
233 |
234 | if (localStorage['locationbar'] === 'true') {
235 | document.getElementById('adv_locationbar').checked = true;
236 | }
237 |
238 |
239 | }
240 |
241 | function openTab(url) {
242 | var tab = safari.application.activeBrowserWindow.openTab();
243 | tab.url = url;
244 | tab.activate();
245 |
246 | }
247 |
248 | function search_input_clear() {
249 | document.getElementById('search_form_input_homepage').value = '';
250 | document.getElementById("search_form_input_clear").style.display= 'none';
251 | document.getElementById('search_form_input_homepage').focus();
252 | document.getElementById("search_button_homepage").className = '';
253 | }
254 |
--------------------------------------------------------------------------------
/duckduckgo.safariextension/html/popup.html:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 | DuckDuckGo
20 |
322 |
323 |
324 |
325 |
330 |
331 |
332 |

333 |
334 |
335 |
336 |
337 |
338 |
SPECIAL
339 |
359 |
360 |
361 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |