Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom sites #1

Open
stefanjcollier opened this issue Apr 16, 2018 · 7 comments
Open

Allow custom sites #1

stefanjcollier opened this issue Apr 16, 2018 · 7 comments

Comments

@stefanjcollier
Copy link

I predominantly work on github enterprise, which is under https://github.<my company>.com.

Being able to add custom sites, i.e. github enterprise ones would be really handy.

You could achieve this by editing the manifest.json to work on https://github.* as well or go for a more sophisticated user input option like octohint does here (unfortunately this is TypeScript not pure JS but you get just about grasp their options page)

@lukechilds
Copy link
Owner

Thanks for the sugestion, that's a great idea!

I'm pretty tied up on another project at the moment, are you interested in submitting a PR?

@lukechilds
Copy link
Owner

Refined GitHub has a very elegant solution:

refined-github/refined-github#819

@bfred-it has even kindly wrapped it up in a reusable module!

https:/bfred-it/webext-dynamic-content-scripts#usage

@stefanjcollier
Copy link
Author

I looked into it (however chrome extensions are a new domain for me) but ended up manually installing it with an edited manifest.

This may be out of my league, so v1 might just be an extra markdown page with custom installation steps and a link to it on the README. That sound ok?

@stefanjcollier
Copy link
Author

Oh wait a minute, why not just append the domain?
"https://github.*.*/*"

@lukechilds
Copy link
Owner

Oh wait a minute, why not just append the domain?
"https://github.*.*/*"

Because that only works for the specific scenario where GHE is installed on github.company.com. If your install is on git.company.com or ghe.company.com it won't work. It also means if I wanted to list some of my GitHub stats on github.lukechilds.co this extension would kick in and break my styles.

The domains it runs on should be scoped as specific as possible. Locking it only to github.com and gist.github.com and allowing users to manually whitelist their own enterprise instance is a much cleaner solution.

This may be out of my league, so v1 might just be an extra markdown page with custom installation steps and a link to it on the README. That sound ok?

I'd rather not encourage forking with modifications because then they won't benefit from any future updates. No worries if it's not something you feel comfortable with. I'll leave this issue open and hopefully someone else can give it a shot. Or when I have more free time to work on OSS, I'll implement it myself.

@stefanjcollier
Copy link
Author

That's fair, I'll give it a shot. But it's probably above me atm.

@fregante
Copy link

fregante commented Aug 7, 2019

I recently published 2 modules that might help you with this:

https:/fregante/webext-domain-permission-toggle
https:/fregante/webext-dynamic-content-scripts

You'd just need:

npm i webext-domain-permission-toggle webext-dynamic-content-scripts
// in background.js
import 'webext-dynamic-content-scripts';
import addDomainPermissionToggle from 'webext-domain-permission-toggle';

addDomainPermissionToggle();

And some adjustments to manifest.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants