Closed raphaeleidus closed 5 years ago
@raphaeleidus Sorry I haven't used GitHub enterprise before, and I don't have enterprise account. Therefore, I could be difficult for me to develop. Hope someone could help this issue out.
I'll take a look at this, after fixing gitlab and bitbucket
I'm a fan of how it was handled as a Browser Action in Refined GitHub: https://github.com/sindresorhus/refined-github/pull/819. Less clicking, less copy-pasting, all-around simpler.
Additionally, it has been spun out into its own npm package: https://github.com/bfred-it/webext-domain-permission-toggle
I'm happy to test anything here, as I'd love to see it on Enterprise as well. The UI is nearly identical, and should be for everywhere this is. I agree with @matchai the way Refined GitHub works (where you're simply prompted for a domain) works very well. Ultimately all we're doing is adding a domain of where this extension runs.
Any update on this?
@charliegroll So far, nop. Would you want to take it?
I think I'll take a crack at it 🙂. https://github.com/stamminator/github-file-icon/blob/master/src/js/background.js should be able to compare a list of dynamic URLs to determine whether or not to apply the styles. The only tricky part would be deciding how to pass them in. Perhaps clicking the extension icon could open a little GUI where custom URLs may be entered. Anyone have any feedback on this approach?
Both GitLab and BitBucket support self-hosting. If GitHub Enterprise is supported, I think it would be easy to also support self-hosted GitLab and BitBucket.
@stamminator Not that easy. Domain name also affect content script:
@franklinyu, gotcha, so when the user is entering their custom URL, they'll also need to select which product they're using from a drop-down or something. These custom URLs can be stored as an array of { url: 'enterprise.domain.com', provider: 'github' }
objects, just as a concept.
I recently published 2 modules that might help you with this:
https://github.com/fregante/webext-domain-permission-toggle https://github.com/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();
You'll also be able to drop the tabs
and webNavigation
permissions, together with:
I'm sending a PR
Ideally in the same way this works: https://github.com/buunguyen/octotree#enterprise-urls