Add "Go to Parent" functionality for HN

This commit is contained in:
Maddison Hellstrom 2018-02-12 19:46:52 -08:00
parent c7def9f2ef
commit a23ca02411
1 changed files with 7 additions and 0 deletions

View File

@ -217,6 +217,12 @@ function twitterFollowUser() {
Hints.create(".follow-button", Hints.dispatchMouseClick)
}
function hnGoParent() {
const par = $(".par>a")
if (par.length <= 0) return
window.location.href = par[0].href
}
// ---- Mapkeys ----//
const ri = { repeatIgnore: true }
@ -287,6 +293,7 @@ mapsitekeys("reddit.com", [
mapsitekeys("news.ycombinator.com", [
["c", "Collapse comment", hnCollapseComment],
["v", "Cast vote", hnVote],
["p", "Go to parent", hnGoParent],
])
// ---- Search & completion ----//