New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Releases
tab to the repo page
#12
Conversation
@@ -59,6 +83,7 @@ document.addEventListener('DOMContentLoaded', () => { | |||
|
|||
if (isRepo) { | |||
gitHubInjection(window, () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gitHubInjection(window, {wait: 1}, () => {
To make it appear faster.
Nice work! When I click the tab and then click the back button in the browser, the Releases tab is duplicated. We need to somehow guard it. @stefanbuck Any tips on how to handle this? Something the |
This way we do not wait for the defaul 250ms before adding a Releases tab.
This works around the browser behaviour of the back button which puts the previous DOM and the Releases button gets put again.
@sindresorhus I think I've addressed your comments. I've also added a quick check if the Releases tab is not already present which solves the back button behaviour. It should also work if GitHub decides to add a Releases tab themselves 馃槃 P.S. Let me know if you want to squash my commits. |
I've also fixed the activation of Releases tab when visiting the Tags page, e.g. https://github.com/sindresorhus/refined-github/tags. |
GitHub.com use some kind of cache for pages that you visited before. So if you navigate back and forth you just switch between the cache pages. That's the reason why the button was added multiple times, because in the cache version it was already there. The quick check that @hkdobrev implemented looks simple and solid 馃憤 |
@stefanbuck Thanks for chiming in. I'm aware of the caching. I was wondering more in the direction of a general solution than having to check everything you add. |
Ahh I see, let me think about it. |
@stefanbuck Ok, cool. Let's continue in OctoLinker/injection#2. |
Releases
tab to the repo page
Perfect! Thank you @hkdobrev. This is a really nice addition. Adding you to the repo per the open open source idea because of this awesome contribution.
We could scrape it from the repo landing page when the user goes there, persist it in localstorage, and then have it available to any repo page. Not sure whether it's worth the trouble, though. |
Fix token regex to support new token format
Closes #8
I've successfully added a releases tab.
However I have some concerns which I hope I'd be able to address with your help.
<span class="octicon octicon-tag">
does not render an icon. I needed to add a full SVG markup like the rest of the icons I could find on github.com.P.S. This also adds a new shortcut
g r
for navigating to the releases page of a repo 馃樅