Skip to content

Instantly share code, notes, and snippets.

@gazambuja
Created November 18, 2019 12:34
Show Gist options
  • Save gazambuja/c50acb629614d484201c2ea922de6691 to your computer and use it in GitHub Desktop.
Save gazambuja/c50acb629614d484201c2ea922de6691 to your computer and use it in GitHub Desktop.
//Enable two page view in google docs
var newWidth = document.getElementsByClassName('kix-zoomdocumentplugin-outer')[0].style.width.replace('px','') *2 +10 +'px';
document.getElementsByClassName("kix-paginateddocumentplugin")[0].style.width = newWidth;
var pages = document.getElementsByClassName("kix-page");
for (var i = 0; i < pages.length; i++) {
if(i==0) {
pages[0].parentNode.width = newWidth;
}
pages[i].style.float = "left";
}
@NoSubstitute
Copy link

NoSubstitute commented Mar 3, 2022

Yeah, this doesn't seem to work anymore.
Others have done similar things, but the Docs code seems to have changed.
Broken: https://github.com/ryanpcmcquen/side_by_side_gdocs

From what I understand it is likely that you are referring to elements that don't exist anymore. That have been renamed or removed.
https://bobbyhadz.com/blog/javascript-cannot-read-property-style-of-undefined

@samsong
Copy link

samsong commented Mar 12, 2022

confirm does not work. can someone find the new element name for: kix-zoomdocumentplugin-outer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment