diff --git a/README.md b/README.md
index 7c77cc9..fe55f60 100644
--- a/README.md
+++ b/README.md
@@ -97,7 +97,7 @@ sites have been included which can help you perform some common actions:
<Space>s | Upvote |
<Space>S | Downvote |
<Space>a | View post (link) |
-<Space>A | View post (link) (new tab) |
+<Space>A | View post (link and comments) |
<Space>c | View post (comments) |
<Space>C | View post (comments) (new tab) |
gp | Go to parent |
diff --git a/actions.js b/actions.js
index 7b2e6e1..4f69552 100644
--- a/actions.js
+++ b/actions.js
@@ -335,6 +335,13 @@ actions.hn.goPage = (dist = 1) => {
actions.openLink(u.href)()
}
+actions.hn.openLinkAndComments = (e) => {
+ const linkUrl = e.querySelector("a.storylink").href
+ const commentsUrl = e.nextElementSibling.querySelector("td > a[href*='item']:not(.storylink)").href
+ actions.openLink(commentsUrl, { newTab: true })()
+ actions.openLink(linkUrl, { newTab: true })()
+}
+
// ProductHunt
// -----------
actions.ph = {}
diff --git a/keys.js b/keys.js
index c51a239..36ec87a 100644
--- a/keys.js
+++ b/keys.js
@@ -390,8 +390,8 @@ const maps = {
},
{
alias: "A",
- description: "View post (link) (new tab)",
- callback: actions.createHint(".storylink", actions.openAnchor({ newTab: true })),
+ description: "View post (link and comments)",
+ callback: actions.createHint(".athing", actions.hn.openLinkAndComments),
},
{
alias: "c",