feat(keys): add Product Hunt bindings
add bindings for producthunt.com, including: - view product - view product (external) - upvote product
This commit is contained in:
parent
2df7fdd0a8
commit
0be265b517
|
@ -165,6 +165,14 @@ actions.hn.collapseNextComment = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ProductHunt
|
||||||
|
// -----------
|
||||||
|
actions.ph = {}
|
||||||
|
actions.ph.openExternal = () => {
|
||||||
|
Hints.create("ul[class^='postsList_'] > li > div[class^='item_']", p =>
|
||||||
|
tabOpenLink(p.querySelector("div[class^='meta_'] > div[class^='actions_'] > div[class^='minorActions_'] > a:nth-child(1)").href))
|
||||||
|
}
|
||||||
|
|
||||||
// Dribbble
|
// Dribbble
|
||||||
// --------
|
// --------
|
||||||
actions.dr = {}
|
actions.dr = {}
|
||||||
|
|
18
keys.js
18
keys.js
|
@ -361,6 +361,24 @@ const maps = {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
|
"producthunt.com": [
|
||||||
|
{
|
||||||
|
alias: "a",
|
||||||
|
description: "View product (external)",
|
||||||
|
callback: actions.ph.openExternal,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
alias: "v",
|
||||||
|
description: "View product",
|
||||||
|
callback: actions.createHint("ul[class^='postsList_'] > li > div[class^='item_'] > a"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
alias: "s",
|
||||||
|
description: "Upvote product",
|
||||||
|
callback: actions.createHint("button[data-test='vote-button']"),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
"dribbble.com": [
|
"dribbble.com": [
|
||||||
{
|
{
|
||||||
alias: "s",
|
alias: "s",
|
||||||
|
|
Loading…
Reference in New Issue