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

Commit

Permalink
Fix #326, support specific google images questions
Browse files Browse the repository at this point in the history
  • Loading branch information
ianb committed Oct 7, 2019
1 parent 5291852 commit 7f178dc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions extension/intents/navigation/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ this.intents.navigation = (function() {
this.intentRunner.registerIntent({
name: "navigation.bangSearch",
match: `
google images (of |) [query] [service=images]
search images (for |) [query] [service=images]
images of [query] [service=images]
(do a |) (search on | query on | lookup on | look up on | look on | look in | look up in | lookup in) (my |) [service:serviceName] (for | for the |) [query]
(do a |) (search | query ) my [service:serviceName] (for | for the |) [query]
(do a |) (search | query | find | find me | look up | lookup | look on | look for) (my | on | for | in |) (the |) [query] (on | in) [service:serviceName]
Expand All @@ -46,14 +49,16 @@ this.intents.navigation = (function() {
"Look up The Book Thief on GoodReads",
"Search CSS grid on MDN",
"Look up Hamilton in Gmail",
"Images of sparrows",
],
async run(context) {
const service = context.slots.service || context.parameters.service;
const myurl = await searching.ddgBangSearchUrl(
context.slots.query,
context.slots.service
service
);
context.addTelemetryServiceName(
`ddg:${serviceList.ddgBangServiceName(context.slots.service)}`
`ddg:${serviceList.ddgBangServiceName(service)}`
);
await context.createTab({ url: myurl });
browser.runtime.sendMessage({
Expand Down

0 comments on commit 7f178dc

Please sign in to comment.