Coder Social home page Coder Social logo

itenium-be / github-stars-links Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 2.0 261 KB

Chrome UserScript that adds a stars badge to github project links

Home Page: https://itenium.be/blog/javascript/starify-github-links/

License: MIT License

JavaScript 100.00%
badge content-script chrome-extension chrome github github-stars

github-stars-links's Introduction

Github Stars

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'];

Example: Google search results

Turn google results for "react github" into:

When googling "react github"

Example: Github Awesome list

Turn sindresorhus awesome-awesome list into:

sindresorhus/awesome

Testing

chrome://extensions/
  • Turn on "Developer mode"
  • Load unpacked
  • Select this folder

Test Urls

CSP Directives

Developer docs

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

Publish

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.

github-stars-links's People

Contributors

laoujin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

mbtolou specter78

github-stars-links's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.