From 7cbf181da7530f1bf434eb054530002cc65e2782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20Cuevas?= Date: Fri, 12 Apr 2019 12:55:20 +0200 Subject: [PATCH] Initial commit of not working extension --- githubpoints-projects.js | 15 +++++++++++++++ icons/githubpoints-48.png | Bin 0 -> 225 bytes manifest.json | 24 ++++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 githubpoints-projects.js create mode 100644 icons/githubpoints-48.png create mode 100644 manifest.json diff --git a/githubpoints-projects.js b/githubpoints-projects.js new file mode 100644 index 0000000..778432e --- /dev/null +++ b/githubpoints-projects.js @@ -0,0 +1,15 @@ +window.onload = function () { + var calculateIssuePoints = function { + document.getElementsByClassName.forEach(function(link) { + let points_mark = link.text.match(/^\(\d+\)*/); + if (points) { + let points = points_mark[0].replace(/\(\)/g, ''); + link.text = link.text.replace(/^\(\d+\)/, '' + points + ''); + } + }); + }; + var updatePoints = function () { + calculateIssuePoints(); + }; + setTimeout(2000, updatePoints); +}; diff --git a/icons/githubpoints-48.png b/icons/githubpoints-48.png new file mode 100644 index 0000000000000000000000000000000000000000..90687de26d71e91b7c82565772a7df470ae277a6 GIT binary patch literal 225 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTCmSQK*5Dp-y;YjHK@;M7UB8wRq zxP?KOkzv*x37}xJr;B4qM&sM7j(iOY0?rpNR{Ym~eNUieh4I>d+mEvHuIy!K@bZ41 zJ}N$e^&*#q7kxbW`Aeg?)>n&l0$ z8xrIlb~3+dVExT-N;ZLA=LS%o!8+lf-GRA$F@Klex9jiV-^0Mj@Zdh*s&","tabs"], + + "content_security_policy": "script-src 'self'; object-src 'self'; font-src 'self';", + + "content_scripts": [ + { + "matches": ["*://*.github.com/*/projects/*"], + "js": ["githubpoints-projects.js"] + } + ] + +}