homerchen19 / github-file-icons

🌈 🗂 A browser extension which gives different filetypes different icons to GitHub, GitLab, gitea and gogs.
https://chrome.google.com/webstore/detail/file-icon-for-github-and/ficfmibkjjnpogdcfhfokmihanoldbfe
MIT License
1.43k stars 68 forks source link

gitlab, bitbucket, gogs and gitea #15

Closed MichielDx closed 6 years ago

MichielDx commented 6 years ago

4

MichielDx commented 6 years ago

Feel free to refactor this 😉 Not the best code

homerchen19 commented 6 years ago

Hi @MichielDx I have viewed your PR, and I think there is too many similar code. In my opinion, I suggest you get window.location.href or window.location.domain to determine which CSS selector should be used. Then, run domain-specific function. Just reduce duplicate code as more as possible, move them to a separate new function. 👍

MichielDx commented 6 years ago

Hey, I would do that but I'm quite busy at the moment. You mind taking a look at it?

homerchen19 commented 6 years ago

Sure. I will do it.

nogweii commented 6 years ago

How hard would it be to support not only gitlab.com, but also other self-hosted installations of Gitlab, Gogs, and Gitea? This is very similar to #2.

(The octotree add-on also is wrestling with this issue for Firefox, see https://github.com/buunguyen/octotree/issues/275)

homerchen19 commented 6 years ago

Hi @evaryont It seems that there is no conclusion yet. This PR could only support some specific domains.