Closed Techn1x closed 5 years ago
Was just looking through the code and noticed that you do have code for this, so clearly it's not working for me for some reason...
https://github.com/jefgen/github-jira-linkifier-webextension/blob/master/src/background.js#L63-L74
I think the problem is this line; https://github.com/jefgen/github-jira-linkifier-webextension/blob/master/src/background.js#L67
When I call document.getElementsByClassName('js-issue-title')
I get 2 elements
The second occurrence of the element is just a link to the top of the page, and can probably be ignored. So maybe just do all elements with classname 'js-issue-title' that are not already links.
If I get some time I'll put a PR together but feel free to beat me (I've never developed a Firefox extension before so I have no idea how to test any changes I make)
Thanks for reporting this issue, and for debugging the problem!
I think I'll change the code to only look for the span
element, which would also avoid possibly creating nested links (nested "a" elements), as it looks like the second element is hidden on the GitHub PR page.
I pushed an updated version of the extension (1.0.4) to the Mozilla Add-ons site. Try checking for updates and let me know if it fixes your issues. Thanks!
Works well, thanks for that!
For what it's worth, the a
element isn't hidden on the page, if you have a longer PR and you scroll down the page it shows up at the top of the page in a small header - but it's probably not worth worrying about
I would find this most helpful - on the PR page, linking the issue number to the Jira ticket