From 58c3895b957b547ed27333e0b40a60cc9aaeaeba Mon Sep 17 00:00:00 2001 From: Nacho Date: Wed, 23 Mar 2022 16:24:07 +0100 Subject: [PATCH] Update 0.4.0 - Added new functionality where you can check for newer version if stuhack is not working --- doc-viewer.js | 11 ++++------- manifest.json | 4 ++-- style.css | 25 +++++++++++++++++++++++++ version-check.js | 14 ++++++++++++++ 4 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 version-check.js diff --git a/doc-viewer.js b/doc-viewer.js index 2829940..feb7f72 100644 --- a/doc-viewer.js +++ b/doc-viewer.js @@ -2,17 +2,14 @@ window.addEventListener('load', function(){ const prev_buttons = document.getElementsByClassName("fa-cloud-download-alt"); button1 = document.createElement("button"); - button1.classList.add("_9a6cb8147b6c"); - button1.classList.add("_692d488d692b"); + button1.classList.add("download-button-1"); button1.setAttribute("id","download-button-1"); - button1.innerHTML = 'Descarga'; + button1.innerHTML = 'Descarga'; button2 = document.createElement("button"); - button2.classList.add("_6bff635a93f8"); - button2.classList.add("_309cf73375f7"); - button2.classList.add("_9a6cb8147b6c"); + button2.classList.add("download-button-2"); button2.setAttribute("id","download-button-2"); - button2.innerHTML = 'Descarga'; + button2.innerHTML = 'Descarga'; prev_buttons[0].parentNode.parentNode.prepend(button1); prev_buttons[1].parentNode.parentNode.removeChild(prev_buttons[1].parentNode); diff --git a/manifest.json b/manifest.json index 6786652..1d75fe6 100644 --- a/manifest.json +++ b/manifest.json @@ -2,11 +2,11 @@ "manifest_version": 3, "name": "StuHack", - "version": "0.3.9", + "version": "0.4.0", "description": "Banner remover, filter pass & document downloader", "content_scripts": [{ - "js": ["remove-banner.js", "doc-viewer.js", "remove-blur.js"], + "js": ["version-check.js", "remove-banner.js", "remove-blur.js", "doc-viewer.js"], "css": ["style.css"], "matches": ["https://www.studocu.com/*"] }] diff --git a/style.css b/style.css index df984c9..c823882 100644 --- a/style.css +++ b/style.css @@ -1,3 +1,28 @@ .nofilter{ filter: none !important; +} + + +.download-button-1, .download-button-2, .github-button{ + background: transparent; + border-radius: 3px; + color: #fff; + display: inline-block; + line-height: 1; + margin: 0 5px; + vertical-align: middle; +} + +.download-button-1{ + background: #5bc787; + padding: 4px 15px; +} + +.download-button-2{ + height: 30px; + min-width: 30px; +} + +.github-button{ + background: #333; } \ No newline at end of file diff --git a/version-check.js b/version-check.js new file mode 100644 index 0000000..37bb42a --- /dev/null +++ b/version-check.js @@ -0,0 +1,14 @@ +window.addEventListener('load', function(){ + version = chrome.runtime.getManifest().version; + + const prev_buttons = document.getElementsByClassName("fa-cloud-download-alt"); + + button_cv = document.createElement("button"); + button_cv.classList.add("github-button"); + + button_cv.innerHTML = 'v.'+version+''; + button_cv.onclick = function() {location.href="https://github.com/isanchop/stuhack/releases/" } + + prev_buttons[0].parentNode.parentNode.prepend(button_cv); + +}); \ No newline at end of file