Currently if you use RGH on a different domain and GitHub, as soon as you provide a token, the other site no longer works (as expected).
features.js:79 RefinedGitHubAPIError: The token seems to be incorrect or expired. Update it in the options.
at call (chrome-extension://mnoacfgkaplmhhcgdnekddifjfcllloj/content.js:2481:11)
at <anonymous>
We need to add the option to specify what URL the token is for and only use it for that domain. This becomes more important if #1713 is merged.
I'd love to fix that, too, but I don't really know where to start.
Refer to https://github.com/sindresorhus/refined-github/pull/1384#issuecomment-398375125
Do we need the option to specify the URL for a token or do we just need an extra field called GHE personal token? I think that would cover most use cases.
eg.

The further we go, the more I think this extension needs to be installed once per domain:
Given that GHE gets features later than regular GitHub, I expect most new features to cause errors so it's always best to wait.
Rather than adding a field, I'd rather see documentation explaining how to:
HEAD@{ISO date 1 month ago})manifest.json so it applies to your GHE URLs instead of github.comorigin when the user wants toEven better would be a cli tool that does this automatically, for any extension, like:
npx web-ext-custom-domain sindresorhus/refined-github github.com:github.mycompany.com --delay 30d
# roughly equivalent to
git clone https://github.com/"$1".git .
git checkout HEAD@"$delay"
npm install
npm run build
sed s/"$from_domain"/"$to_domain" distribution/manifest.json
dot-json distribution/manifest.json name "$name ($to_domain)"
I'm not sure that's the right solution since there are still a lot of new features added to refined-github that work well with GHE and if there is a GHE fix you'd probably want to pick up that fix right away. There's only one open bug right now that with the GHE label.
There's only one open bug right now that with the GHE label.
That's because we had to fix (or ignore) all the others
Another option would be to support disabling some features in GHE (like for example recently-pushed-branches-enhancements)... either by:
...until they are properly supported in GHE. I don't think this is really necessary though. You can already disable extensions (and will be even easier with https://github.com/sindresorhus/refined-github/pull/1780) which more or less solves the problem.
Another option would be to support disabling some features in GHE
That only gives my suggestion more reason to exist. If you have a GHE-specific extension, you can disable the features that don't work there, just for GHE, without further changes in Refined GitHub.
I don't use Enterprise at all so even if I wanted to I couldn't tell what works there and what doesn't.
I opened a request here: https://github.com/sindresorhus/module-requests/issues/114
I personally prefer having a single "copy" of the extension that updates itself and picks up the latest features and fixes for both public Github and GHE. The main issue is the token issue. I don't think adding a second token text field for GHE really clutters up the extension options? Your other suggestion would work well too I think...
Rather than adding 150 lines of code I'd welcome a raw-er input, e.g. single textarea, comma+line separated input.
I guess the question is what kind of PR would you accept to resolve this issue? Or maybe we need input from other people who use GHE?
No PR other than the tool I described, probably, because if this field is added someone else will ask another field for their second GHE installation (see #1384)
An alternative solution would be to extend webext-options-sync to have per-domain storage and we’d have automatic per-domain tabs (created by Refined GitHub) in the options.
This is actually kind of possible since webext-options-sync lets you change the storage key (currently stored as options in chrome.storage.sync), we just need to ensure that:
https://github.com/sindresorhus/refined-github/pull/2111 contains code useful to generate those tabs (i.e. “what additional domains do we have permission to?”)
Most helpful comment
An alternative solution would be to extend
webext-options-syncto have per-domain storage and we’d have automatic per-domain tabs (created by Refined GitHub) in the options.This is actually kind of possible since
webext-options-synclets you change the storage key (currently stored asoptionsinchrome.storage.sync), we just need to ensure that:https://github.com/sindresorhus/refined-github/pull/2111 contains code useful to generate those tabs (i.e. “what additional domains do we have permission to?”)