Skip to content

Commit

Permalink
Merge pull request #2 from rtk-rnjn/patch-1
Browse files Browse the repository at this point in the history
feat: add bing and yt search
  • Loading branch information
mepowerleo10 authored Nov 6, 2024
2 parents 4184223 + bbd1f34 commit bb0dea6
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,24 @@ class ChromeSearchProvider {
return `https://duckduckgo.com/?q=${encodeURIComponent(query)}`;
}
},
'bing': {
name: 'Search Bing',
description: 'Search online with Bing',
icon: 'web-browser-symbolic',
getQuery: function (terms) {
const query = terms.slice(1).join(" ");
return `https://www.bing.com/search?q=${encodeURIComponent(query)}`;
}
},
'youtube': {
name: 'Search YouTube',
description: 'Search online with YouTube',
icon: 'web-browser-symbolic',
getQuery: function (terms) {
const query = terms.slice(1).join(" ");
return `https://www.youtube.com/results?search_query=${encodeURIComponent(query)}`;
}
},
};
}

Expand Down Expand Up @@ -201,6 +219,15 @@ class ChromeSearchProvider {
case 'd':
identifiers.push('duckduckgo');
break;
case 'b':
identifiers.push('bing');
break;
case 'y':
identifiers.push('youtube');
break;
case 'g':
identifiers.push('google');
break;
default:
identifiers.push('google')
break;
Expand Down Expand Up @@ -273,4 +300,4 @@ export default class ChromeSearchProviderExtension extends Extension {
Main.overview.searchController.removeProvider(this._provider);
this._provider = null;
}
}
}

0 comments on commit bb0dea6

Please sign in to comment.