xthexder / wide-github

Change all github repository pages to be full width and dynamically sized.
MIT License
374 stars 71 forks source link

Support for Github Enterprise #9

Open erikdw opened 9 years ago

erikdw commented 9 years ago

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?

moreati commented 9 years ago

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.

xthexder commented 9 years ago

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).

erikdw commented 9 years ago

@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 commented 9 years ago

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.
ygrek commented 9 years ago

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

erikdw commented 9 years ago

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

ygrek commented 9 years ago

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

xthexder commented 9 years ago

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

erikdw commented 9 years ago

@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.

ygrek commented 7 years ago

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

fregante commented 4 years ago

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.