Created
October 4, 2020 08:58
-
-
Save mohammed-io/acae461995663455cbbdde9c878e8613 to your computer and use it in GitHub Desktop.
Prints the resume from rxresu.me
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a id="link" href="">Print Rx Resume</a> | |
<script id="js"> | |
function init() { | |
if (window.location.host != 'rxresu.me') { | |
if (!confirm("This supposed to run on https://rxresu.me/.\nRun anyway?")) { | |
return; | |
} | |
} | |
const resume = [...document.querySelectorAll('#page')].map(n => n.cloneNode(true))[0]; | |
if (!resume) return alert("Resume not found on the page!"); | |
document.body.append(resume); | |
print(); | |
resume.remove(); | |
} | |
</script> | |
<script> | |
addEventListener('load', () => { | |
const script = document.getElementById('js').innerHTML; | |
const href = script => `javascript:(${script})()`; | |
document.getElementById('link').href = href(script); | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment