-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add support for GitHub Enterprise #450
Conversation
@bfred-it this is gold. |
Should there be an option to see currently added domains and remove them if no longer needed? |
@busches I don't think it's a big deal, worst thing that can happen is that a domain you no longer use takes 20 bytes on disk, I think. |
@bfred-it Very nice work! Tested this on GHE and the actual permission stuff worked great. All of the css changes worked without issue. However the javascript doesn't fire at all because this is loading after the page loaded and the javascript changes are done using a listen on the DOMContentLoaded event and not taking into account if it's loaded after that event has triggered. Should be easy to fix. content.js should probably be executed last (right now there are a few after it and just calling the content loaded function errors because of this) It also looks like right now you're guaranteeing execution order - the javascript is noticeably slower to load on the GHE sites as well and this may be why. We should be able to load all of them async except for content.js and load that after, right? I'm not sure if this is why we are firing after the dom loaded event or not, but either way it would improve speed of load. |
Thanks for the info! I'll apply the two fixes (domready and content.js loaded last) but the speed will automatically be improved once #404 is in and only a file is loaded. I'll also try removing the order guarantee, perhaps Chrome already does this (premature optimization?) |
I don't use GHE, so this PR is out of my reach I think. @hkdobrev maybe? Or @jgierer12? |
refined-github/refined-github#450 (comment) 724281 Chrome seems to already run scripts in order. Tested with file 1. ember + three.js + console.log(1) file 2. console.log(2)
i.e. GitHub Enterprise
* Only inject the scripts when permitted * Move potentially slow operation to the last moment
|
* Remove redundant+slow operation order guarantee
Nope, I don't use GHE either |
@bfred-it Got it Confirming this is working for me on GHE. Also note you can see what sites you gave permission to in the settings for the extension. |
Thanks @derimagia! Hopefully this can be merged/squashed soon :) |
extension/options/index.html
Outdated
@@ -1,5 +1,5 @@ | |||
<!DOCTYPE html> | |||
<meta charset="UTF-8"> | |||
<!doctype html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's case-insensitive, but the official one is actually uppercase: https://html.spec.whatwg.org/multipage/syntax.html#the-doctype
extension/options/index.html
Outdated
<!DOCTYPE html> | ||
<meta charset="UTF-8"> | ||
<!doctype html> | ||
<meta charset="utf-8"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine 👍
This works well for the most part. There are still a lot of places that have |
@busches do you see value in merging this now to get at least some features working while further and specific issues can be reported and fixed later? |
@bfred-it yes. We'd just need to create an issue for what I mentioned above. |
Cool. There's a chance that some features won't ever be available or compatible with GHE, but custom domain support at least gives a basis for other to find and fix issues too, especially because I don't actually have access to any GHE. |
@bfred-it I'd be happy to work with you as needed, what features aren't compatible with it would you say? |
@derimagia anything that has
There could be more, but from a quick glance at the code and attempting them, those don't work. |
Sorry I mean't this part of it: "Some features won't ever be available or compatible with GHE" - is it that they can't be done or that we would need to fix the hard code locations? |
I don't have GHE so I'm only guessing of other possible issues, considering that GHE is not 1:1 with GH The URLs might only need to be changed from |
@busches Can you open an issue about further improvements to GHE support? |
@bfred-it Can you mention GHE support in the readme? |
Just a heads-up, this doesn't work on Firefox since it doesn't allow changing permissions dynamically. I don't think there's much we can do about it currently, so maybe mention this in the readme too @bfred-it |
Pinging some people who showed interest in Refined GitHub Enterprise:
Would you mind giving it a go and reporting new issues? |
Thank you so much for adding the support. I was adding the GHE URL to manifest file as workaround. Works for me but only after installing it from store. When loading locally, it does not work.
I pulled latest master and:
|
That's just Chrome being annoying. You can ignore that warning, it works anyway, you have to authorize the domain again in the options. |
Fixes #315
New domains can be specified in GH's options view, which can also help #193, should that ever materialize.
To test this without access to GHE:
github.com
inmanifest.json
github.com
should not be therehttps://github.com
via the form