Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search bar should start default search engine search #28

Merged
merged 1 commit into from Nov 10, 2020
Merged
Changes from all commits
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -108,7 +108,7 @@ browser.runtime.onMessage.addListener(async ({ action, args }, { tab }) => {
}

if (action === 'getTopSites') {
if (browser.ghostery.getPref('app.update.channel') !== 'release') {
if (browser.ghostery.getPref('app.update.channel') === 'release') {
return;
}
return (await browser.topSites.get({
@@ -117,11 +117,10 @@ browser.runtime.onMessage.addListener(async ({ action, args }, { tab }) => {
})).filter(site => site.type === 'url');
}

if (action === 'focusUrlbar') {
browser.ghostery.query(args[0]);
}

if (action === 'getSearchEngines') {
if (browser.ghostery.getPref('app.update.channel') === 'release') {
return;
}
return (await browser.search.get()).filter(
engine => engine.name !== browser.runtime.getManifest()["chrome_settings_overrides"]["search_provider"].name
);
@@ -2,15 +2,15 @@

(async function () {
function observerSearchInput() {
const input$ = document.querySelector('#search-input');
input$.addEventListener('input', () => {
const form$ = document.querySelector('form');
form$.addEventListener('submit', () => {
const input$ = document.querySelector('#search-input');
browser.runtime.sendMessage({
action: 'focusUrlbar',
args: [
input$.value,
],
action: 'search',
args: [{
query: input$.value,
}],
});
input$.value = '';
});
}

@@ -1,5 +1,5 @@
{
"version": "0.1.14",
"version": "0.1.15",
"browser_specific_settings": {
"gecko": {
"id": "search@ghostery.com"
@@ -19,7 +19,7 @@
"https://*.ghosterysearch.com/",
"http://localhost/*"
],
"js": ["content/login-cta.js", "content/top-sites.js", "content/focus-urlbar.js"]
"js": ["content/login-cta.js", "content/top-sites.js", "content/search-bar.js"]
}, {
"matches": [
"https://*.ghosterysearch.com/search*",
ProTip! Use n and p to navigate between commits in a pull request.