thieman / github-selfies

Everything is better with selfies. Yes, even pull requests. Trust me.
MIT License
1.14k stars 76 forks source link

Extension not working for git repositories that contain a . character. #88

Closed mark-truran closed 5 years ago

mark-truran commented 6 years ago

Example url: https://www.github.com/exampleowner/example.repository/pulls/1

Github selfie doesn't like the . in example.repository and therefore fails to load into the page.

Potentially the 'allowed paths' regex list? @ https://github.com/thieman/github-selfies/blob/master/chrome/selfie.js#L37

I can't selfie my company repositories because of this. Please fix.

ChaseWagoner commented 6 years ago

When attempting to sign up for GitHub:

Username may only contain alphanumeric characters or single hyphens, and cannot begin or end with a hyphen

When attempting to create a repository, GitHub allows alphanumeric, periods, hyphens, and underscores; anything else is converted to a hyphen.

However, these rules are more strict than the allowedPaths need to be; since usernames and repository names, by rule, can't contain forward slashes, the patterns could be changed to accept any character until the next forward slash, for example:

// Any non-slash character
/github.com\/[^\/]+\/[^\/]+\/issues\/new/
// Or a lazy wildcard
/github.com\/.+?\/.+?\/issues\/new/
thieman commented 5 years ago

This was hopefully fixed by #94 which rolled out in version 2.0.5. Going to close this issue, if it's still a problem please reopen.