refined-github/github-url-detection

Specific detection for file and directory commit lists

shinenelson opened this issue · 1 comments

Following from refined-github/refined-github#4677 (review)

We do not have a detection that distinguishes commit lists for files and directories. There is isCommitList which is a merge of isRepoCommitList and isPRCommitList.

Maybe, we should add a isFileCommitList and isDirectoryCommitList and merge them into isRepoCommitList.

However, I am not sure how to distinguish between a directory and a file from the URL. File extensions seems like a non-safe of detection. If there is a more safer way to distinguish between the file and directories, I will be happy to open a pull request for it.

Yeah there’s no way from the URL and it doesn’t need to be added here. It can be determined from the DOM, ideally from some meta tags in the HEAD, otherwise we just need to look for specific /blob/ links on the page