
Show HN: Add the Missing “My Posts” & “My Comments” Links on Top of HN Website - el_programmador
https://gist.github.com/prahladyeri/e38ba5ff6ea1c71edebd71105713c9d8
======
bgdam
This really doesn't require a heavy jQuery dependency. I also don't know why
the font related style changes are necessary.

You could rewrite this script to be as simple as:

    
    
        const me = document.querySelector("a#me").innerText;
        const header = document.querySelector("span.pagetop");
        header.innerHTML = header.innerHTML + "<a class='myaddons' href='https://news.ycombinator.com/submitted?id=" + me + "'>| my posts |</a>";
        header.innerHTML = header.innerHTML + "<a class='myaddons' href='https://news.ycombinator.com/threads?id=" + me +  "'> my cmts |</a>";
    
    

Much more efficient and does the job without the heavy jQuery dependency.

I do commend your initiative though, and I'm sure many users will get much use
of this.

------
toothandtail
Probably worth looking into this existing project:
[https://github.com/etcet/HNES](https://github.com/etcet/HNES)

