Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

Commit

Permalink
Fix #190, open site-specific searches in a new tab
Browse files Browse the repository at this point in the history
Also allow 'in' in addition to 'on' in site-specific searches, like 'in Gmail'
  • Loading branch information
ianb committed Sep 19, 2019
1 parent e68b861 commit 328d6d7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions extension/intents/navigation/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ this.intents.navigation = (function() {
name: "navigation.bangSearch",
match: `
(do a |) (search | query | look up | lookup | look on | look for) (my |) [service:serviceName] (for | for the |) [query]
(do a |) (search | query | find | find me | look up | lookup | look on | look for) (my | on | for |) (the |) [query] on [service:serviceName]
(do a |) (search | query | find | find me | look up | lookup | look on | look for) (my | on | for | in |) (the |) [query] (on | in) [service:serviceName]
`,
examples: [
"Search my Gmail for tickets to Hamilton",
"Look up The Book Thief on GoodReads",
"Search CSS grid on MDN",
"Look up Hamilton in Gmail",
],
async run(desc) {
const myurl = await searching.ddgBangSearchUrl(
Expand All @@ -55,7 +56,7 @@ this.intents.navigation = (function() {
desc.addTelemetryServiceName(
`ddg:${services.ddgBangServiceName(desc.slots.service)}`
);
await browser.tabs.update({ url: myurl });
await browser.tabs.create({ url: myurl });
browser.runtime.sendMessage({
type: "closePopup",
sender: "find",
Expand Down

0 comments on commit 328d6d7

Please sign in to comment.