Skip to content

Instantly share code, notes, and snippets.

@headquarters
Last active December 28, 2015 17:49
Show Gist options
  • Save headquarters/7538935 to your computer and use it in GitHub Desktop.
Save headquarters/7538935 to your computer and use it in GitHub Desktop.
Cleans up Google Form "Live View" for printing.
(function(){
//remove the "Edit" button
var editLink = document.getElementsByClassName('ss-edit-link');
if(editLink.length){
editLink[0].remove();
}
//remove the "Google" copyright footer
var copyright = document.getElementsByClassName('ss-footer');
if(copyright.length){
copyright[0].remove();
}
//remove the "Submit" button and associated text (you can't submit a paper form, right?)
var navigate = document.getElementsByClassName('ss-navigate');
if(navigate.length){
navigate[0].remove();
}
//remove border
var container = document.getElementsByClassName('ss-form-container');
if(container.length){
container[0].style.borderWidth = 0;
}
//set background to white so it's consistent
document.body.style.backgroundColor = "#ffffff";
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment