wide-github icon indicating copy to clipboard operation
wide-github copied to clipboard

Support for Github Enterprise

Open erikdw opened this issue 10 years ago • 12 comments
trafficstars

My company uses GitHub Enterprise, and that's where I really want this functionality. Maybe there could be an option for applying the widening changes a list of sites?

erikdw avatar May 05 '15 01:05 erikdw

It looks like https://github.com/jamesmmchugh/wide-github is a fork that matches any URL. Or prawnpie/wide-github@20c700252f76ff652de88fce4fbf5f05ee82a5c5 shows how to make a version specific to your organisation.

moreati avatar Jul 07 '15 09:07 moreati

I would recommend just forking this and changing the URL yourself. I'm hesitant to make this work on enterprise because it would require running some JS on every site to figure out if it's github or not (because there's not standard enterprise url).

xthexder avatar Jul 07 '15 14:07 xthexder

@moreati : thanks! I was able to use @jamesmmchugh's repo and it worked for my company's Github Enterprise setup (our domain starts with "github.", I'm assuming that's why it worked given the URLs in the manifest). Thankfully James had instructions on his repo's README for loading an unpacked extension, because I had no idea how to load this.

@xthexder: I was thinking something along the lines of adblock where you can add hosts/URLs for the change to be applied. But given I know nothing about chrome extension development, I cannot guess whether that's a ton of work or not.

erikdw avatar Jul 08 '15 21:07 erikdw

So for future reference here's how I accomplished it:

  1. cloned https://github.com/jamesmmchugh/wide-github (notably the latest commit was 75f545c416)
  2. followed Chrome instructions for loading unpacked extension, pointing at the base dir of the cloned repo: https://developer.chrome.com/extensions/getstarted#unpacked
  3. Profit.

erikdw avatar Jul 08 '15 21:07 erikdw

greasemonkey for firefox allows to add "included sites" url pattern

ygrek avatar Jul 14 '15 00:07 ygrek

@ygrek : can you give more info on that proposal?

erikdw avatar Jul 14 '15 01:07 erikdw

it's not a proposal, greasemonkey plugin for firefox has the functionality to change url patterns builtin, so I can use thise userscript for github enterprise just adding one line in plugin settings

ygrek avatar Jul 14 '15 01:07 ygrek

In Greasemonkey if you select "Manage User Scripts..." you can add something like *https://github.* to "Included Pages" under the wide-github preferences.

xthexder avatar Jul 14 '15 01:07 xthexder

@xthexder : thanks for the detailed explanation (I don't know anything about greasemonkey or other browser plugin development/hacking stuff). @ygrek : thanks for original idea.

erikdw avatar Jul 14 '15 05:07 erikdw

ftr tampermonkey for chrome also allows to override include pattern without modifying script - convenient

ygrek avatar Jun 12 '17 19:06 ygrek

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();

And some adjustments to manifest.json

Here I wrote more about how it works too.

This only works for the browser extension and not the userscript. The only code that runs is to check whether the extension has permission to the current URL.

fregante avatar Jan 21 '20 09:01 fregante

So for future reference here's how I accomplished it:

  1. cloned https://github.com/jamesmmchugh/wide-github (notably the latest commit was 75f545c)
  2. followed Chrome instructions for loading unpacked extension, pointing at the base dir of the cloned repo: https://developer.chrome.com/extensions/getstarted#unpacked
  3. Profit.

An even easier option perhaps for those not interested in cloning the repo etc. These instruction are for Brave Browser, but should be very similar for Chrome.

  1. Install the extension https://chromewebstore.google.com/detail/wide-github/kaalofacklcidaampbokdplbklpeldpj
  2. Go to extension location, for macOS it's ~/Library/Application\ Support/BraveSoftware/Brave-Browser/Profile\ 4/Extensions/kaalofacklcidaampbokdplbklpeldpj (make sure to point to the right profile number)
  3. Right-click the kaalofacklcidaampbokdplbklpeldpj directory and chose compress to zip it up
  4. Back to extension in your browser and remove the Wide GitHub extension
  5. Back to your extensions folder and unzip the extension you zipped in step 3
  6. Open the /manifest.json file and add your GHE domain to the $.content_scripts.matches list and save this change
  7. Open the extension section in the browser and go to developer mode, select "Load Unpacked" and go to the kaalofacklcidaampbokdplbklpeldpj directory and click select
  8. This will install the modified extension

LunaticoCR avatar Oct 07 '24 13:10 LunaticoCR