Skip to content

Commit

Permalink
clean up, tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
hns258 committed Oct 27, 2022
1 parent 6d80556 commit e934d0e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
7 changes: 3 additions & 4 deletions fixtures/fixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ contextMenu({
}
],
append: () => {},
addSearchWithOther:
{
title: 'DuckDuckGo',
url: 'https://duckduckgo.com/?q=%s'
addSearchWithOther: {
title: 'Wolfram Alpha',
url: 'https://www.wolframalpha.com/input?i=%s'
},
showCopyImageAddress: true,
showSaveImageAs: true,
Expand Down
17 changes: 8 additions & 9 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,26 +196,25 @@ declare namespace contextMenu {
Add a `Search with {searchEngine}` menu item when right-clicking text.
This allows the use of a search engine besides Google (e.g., Bing and DuckDuckGo). The `title` and `url` of the desired search engine need to be provided. The `{searchEngine}` placeholder will be replaced by `title`.
@property {string} title Title/name of search engine
@property {string} url URL of search engine (with query syntax used in Chrome)
@property {string} title - The title/name of the search engine.
@property {string} url - The search engine's results [URL with `%s` in place of query](https://support.google.com/chrome/answer/95426#ts&zippy=%2Curl-with-s-in-place-of-query-field) (syntax used in Chrome).
@example
```
{
addSearchWithOther: {
title: 'Bing',
url: 'https://www.bing.com/search'
title: 'DuckDuckGo',
url: 'https://duckduckgo.com?q=%s'
}
};
}
```
@example
```
{
addSearchWithOther: {
title: 'DuckDuckGo',
url: 'https://duckduckgo.com'
title: 'Wolfram Alpha',
url: 'https://www.wolframalpha.com/input?i=%s'
}
};
}
```
*/
readonly addSearchWithOther?: {title: string; url: string};
Expand Down
16 changes: 8 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,26 +154,26 @@ This allows the use of a search engine besides Google (e.g., Bing and DuckDuckGo

Properties:

`title` - string - Title/name of search engine
`title` - string - The title/name of the search engine.

`url` - string - URL of search engine (with query syntax used in Chrome)
`url` - string - The search engine's results [URL with `%s` in place of query](https://support.google.com/chrome/answer/95426#ts&zippy=%2Curl-with-s-in-place-of-query-field) (syntax used in Chrome).

Examples:
```js
{
addSearchWithOther: {
title: 'Bing',
url: 'https://www.bing.com/search'
title: 'DuckDuckGo',
url: 'https://duckduckgo.com?q=%s'
}
};
}
```
```js
{
addSearchWithOther: {
title: 'DuckDuckGo',
url: 'https://duckduckgo.com'
title: 'Wolfram Alpha',
url: 'https://www.wolframalpha.com/input?i=%s'
}
};
}
```

#### showSelectAll
Expand Down

0 comments on commit e934d0e

Please sign in to comment.