Created
November 18, 2019 12:34
-
-
Save gazambuja/c50acb629614d484201c2ea922de6691 to your computer and use it in GitHub Desktop.
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
//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"; | |
} |
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
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
Hi! I found this code from https://www.youtube.com/watch?v=v7EOc4Nm8Po
I tried it and I am getting the following error message:
VM3051:2 Uncaught TypeError: Cannot read properties of undefined (reading 'style')
at :2:82
Any help is appreciated!