Add Github Stars badges to Github project links.
Activates directly on activateDirectlyOn
array. For other websites, press Control + Alt + G
// Defaults +/- to
const activateDirectlyOn = ['stackoverflow.com', 'google.com', 'github.com'];
Turn google results for "react github" into:
Turn sindresorhus awesome-awesome list into:
chrome://extensions/
- Turn on "Developer mode"
- Load unpacked
- Select this folder
- Github
- Unexisting Repo: Would need to do a XMLHttpRequest so the returned content svg content can be examined for "Repo not found"
- StackOverflow
- Bing
- npmjs: Bug: when selecting another package, the shield.io does not refresh
- nuget
// Suggestion from docs did not help for github.com
const xhr = new XMLHttpRequest();
xhr.open('GET', shieldUrl, true);
xhr.responseType = 'blob';
xhr.onload = function(e) {
const badge = document.createElement('img');
badge.src = window.URL.createObjectURL(this.response);
el.prepend(badge);
};
xhr.send();
Publishing to the Chrome Web Store
- Increase version in
manifest.json
gulp
will create./dist/github-stars.zip
Upload it to the store and pick 3 dots > "Developer Dashboard".
npm install
npm run build
# Or with global Gulp
gulp
# Rebuild on changes
npm run watch
Do need to click reload in chrome://extensions
after each change to the code.