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.44k stars 69 forks source link

Support gitlab/bitbucket? #4

Closed MichielDx closed 6 years ago

homerchen19 commented 6 years ago

I haven't used them for long time. Would you want to send a PR 😄 ?

selfup commented 6 years ago

As well as gogs and gitea 😄

MichielDx commented 6 years ago

I'll try for gitlab and bitbucket, but I'm don't know how to test it locally 😄

I also get this error when build and starting:

              ...JSON.parse(content.toString()),
              ^^^
SyntaxError: Unexpected token ...
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
homerchen19 commented 6 years ago

Just run npm run start, then webpack will auto reload when you save changes. What's your nodejs version in your local computer?

MichielDx commented 6 years ago

My node version is 6.9.2

I'm not home atm, so I will try that out later

MichielDx commented 6 years ago

Just ran npm run start and it gives the same error

homerchen19 commented 6 years ago

That's strange... Spread operator should be okay after version 6. Could you delete node_modules and run yarn to reintall everything again? I couldn't figure out what anything else causes this problem.

MichielDx commented 6 years ago

Okay, so I did what you said but it didn't work. After reinstalling node it worked

homerchen19 commented 6 years ago

Awesome!

MichielDx commented 6 years ago

I'm not sure how to test it locally though, sorry

MichielDx commented 6 years ago

oops Accidently closed this

homerchen19 commented 6 years ago

Check this https://developer.chrome.com/extensions/getstarted#unpacked

Select /build directory which is build by webpack on the last step.

MichielDx commented 6 years ago

Okay, for some reason even when I remove the git url check it still doesn't work on gitlab or bitbucket. And it doesn't show under contentscripts when I check the sources...

Sorry for all the questions, never worked on an extension before 😄

homerchen19 commented 6 years ago

No worries. According to here, property matches is required. You could change it to gitlab or bitbucket url. It means content_scripts should be injected when you open those websites.

MichielDx commented 6 years ago

Got gitlab and bitbucket working, but I get a 403 when trying to push to new branch

selfup commented 6 years ago

@MichielDx did you fork? Sounds like you are pushing directly to this repo

MichielDx commented 6 years ago

Oh, didn't know you had to do that :sweat_smile: First time doing this

selfup commented 6 years ago

Yep no worries :+1:

Happens to everyone :stuck_out_tongue: