https://gist.github.com/Snarp/6c06f60899ca3f43bdd3d8170885f83f
NOTE - 2021-05-24
The script below isn’t the fastest way to copy-and-paste from a protected Google Doc. Before trying it, I’d suggest following MikoFrosty’s advice from the comments:
-
Change the end of the document url from
/editto/mobilebasic. -
Disable Javascript (as described in steps 2 and 3 below).
-
Keeping the console open, reload the page.
That should be enough to allow you to copy freely. The script here is probably only necessary if the /mobilebasic view isn’t rendering something correctly.
HOW TO USE
-
Open the protected Doc using Chrome. Scroll all the way down to the bottom to make sure that it is entirely loaded.
-
Open Chrome Developer Tools (<Ctrl+Shift+I>), and click “Console” to open the Javascript Console.
-
Open the Command Console (<Ctrl+Shift+P>). Type “javascript”, and select the option “Disable Javascript” when it appears.
-
Copy the script below into the Javascript console.
-
Leaving the Javascript Console open, you may now copy-and-paste from the document as normal. (Some formatting may be broken. Closing the console may re-lock copy-and-pasting.)
-
(OPTIONAL) To copy the entire document as plain text (no formatting), type the following into the console:
document.body.innerText
The text will be loaded into the Console itself; copy it by clicking the gray-highlighted “COPY” at the end.
function rtcScript() { document.oncontextmenu = null; document.onselectstart = null; document.onmousedown = null; document.onclick = null; document.oncopy = null; document.oncut = null; var elements = document.getElementsByTagName(’*’); for (var i = 0; i < elements.length; i++) { elements[i].oncontextmenu = null; elements[i].onselectstart = null; elements[i].onmousedown = null; elements[i].oncopy = null; elements[i].oncut = null; } function preventShareThis() { document.getSelection = window.getSelection = function() { return {isCollapsed: true}; } } var scripts = document.getElementsByTagName(‘script’); for (var i = 0; i < scripts.length; i++) { if (scripts[i].src.indexOf(‘w.sharethis.com’) > -1) { preventShareThis(); } } if (typeof Tynt != ‘undefined’) { Tynt = null; } } rtcScript(); setInterval(rtcScript, 2000);