Skip to content

Commit

Permalink
Update 0.4.0 - Added new functionality where you can check for newer …
Browse files Browse the repository at this point in the history
…version if stuhack is not working
  • Loading branch information
isanchop committed Mar 23, 2022
1 parent 61b8304 commit 58c3895
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 9 deletions.
11 changes: 4 additions & 7 deletions doc-viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="cloud-download-alt" class="svg-inline--fa fa-cloud-download-alt " role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path fill="currentColor" d="M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zm-132.9 88.7L299.3 420.7c-6.2 6.2-16.4 6.2-22.6 0L171.3 315.3c-10.1-10.1-2.9-27.3 11.3-27.3H248V176c0-8.8 7.2-16 16-16h48c8.8 0 16 7.2 16 16v112h65.4c14.2 0 21.4 17.2 11.3 27.3z"></path></svg><span class="_2fbdc464604d">Descarga</span>';
button1.innerHTML = '<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="cloud-download-alt" class="svg-inline--fa fa-cloud-download-alt " role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path fill="currentColor" d="M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zm-132.9 88.7L299.3 420.7c-6.2 6.2-16.4 6.2-22.6 0L171.3 315.3c-10.1-10.1-2.9-27.3 11.3-27.3H248V176c0-8.8 7.2-16 16-16h48c8.8 0 16 7.2 16 16v112h65.4c14.2 0 21.4 17.2 11.3 27.3z"></path></svg><span style="margin-left: 5px">Descarga</span>';

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 = '<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="cloud-download-alt" class="svg-inline--fa fa-cloud-download-alt " role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path fill="currentColor" d="M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zm-132.9 88.7L299.3 420.7c-6.2 6.2-16.4 6.2-22.6 0L171.3 315.3c-10.1-10.1-2.9-27.3 11.3-27.3H248V176c0-8.8 7.2-16 16-16h48c8.8 0 16 7.2 16 16v112h65.4c14.2 0 21.4 17.2 11.3 27.3z"></path></svg><span class="_2fbdc464604d">Descarga</span>';
button2.innerHTML = '<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="cloud-download-alt" class="svg-inline--fa fa-cloud-download-alt " role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path fill="currentColor" d="M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zm-132.9 88.7L299.3 420.7c-6.2 6.2-16.4 6.2-22.6 0L171.3 315.3c-10.1-10.1-2.9-27.3 11.3-27.3H248V176c0-8.8 7.2-16 16-16h48c8.8 0 16 7.2 16 16v112h65.4c14.2 0 21.4 17.2 11.3 27.3z"></path></svg><span style="margin-left: 5px">Descarga</span>';

prev_buttons[0].parentNode.parentNode.prepend(button1);
prev_buttons[1].parentNode.parentNode.removeChild(prev_buttons[1].parentNode);
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/*"]
}]
Expand Down
25 changes: 25 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -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;
}
14 changes: 14 additions & 0 deletions version-check.js
Original file line number Diff line number Diff line change
@@ -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 = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 90 60" aria-labelledby="title" aria-describedby="desc" role="img" class="svg-inline--fa" xmlns:xlink="http://www.w3.org/1999/xlink"><path data-name="layer" d="M32 0a32.021 32.021 0 0 0-10.1 62.4c1.6.3 2.2-.7 2.2-1.5v-6c-8.9 1.9-10.8-3.8-10.8-3.8-1.5-3.7-3.6-4.7-3.6-4.7-2.9-2 .2-1.9.2-1.9 3.2.2 4.9 3.3 4.9 3.3 2.9 4.9 7.5 3.5 9.3 2.7a6.93 6.93 0 0 1 2-4.3c-7.1-.8-14.6-3.6-14.6-15.8a12.27 12.27 0 0 1 3.3-8.6 11.965 11.965 0 0 1 .3-8.5s2.7-.9 8.8 3.3a30.873 30.873 0 0 1 8-1.1 30.292 30.292 0 0 1 8 1.1c6.1-4.1 8.8-3.3 8.8-3.3a11.965 11.965 0 0 1 .3 8.5 12.1 12.1 0 0 1 3.3 8.6c0 12.3-7.5 15-14.6 15.8a7.746 7.746 0 0 1 2.2 5.9v8.8c0 .9.6 1.8 2.2 1.5A32.021 32.021 0 0 0 32 0z" fill="#fff"></path></svg><span>v.'+version+'</span>';
button_cv.onclick = function() {location.href="https://github.com/isanchop/stuhack/releases/" }

prev_buttons[0].parentNode.parentNode.prepend(button_cv);

});

0 comments on commit 58c3895

Please sign in to comment.