6

I just came upon a Google doc from a high school account that I no longer have access to. I want to copy paste my work, but the copy paste functionality is disabled. I know you could access developer tools such as document.body.innerText to get a text copy of the doc. I would, however, prefer to have the actual doc and its formatting kept, so I would need a print screen of the entire doc (and then run it by Optical Text Recognition) or just get the copy paste functionality. There is JavaScript blocking the copying functionality, and upon disabling the JavaScript, the page does not load (error). Would anyone be able to help me out, please?

3
  • 1
    If you right-click on the doc in Google Drive, is there an option "Make a copy"?
    – ahorn
    Mar 20 '19 at 7:44
  • Similar question on SO, and a comment offers an example protected doc to practice on.
    – Rob
    Mar 20 '19 at 17:27
  • Ya I actually saw that question on SO. Problem is that those two techniques (disabling javascript/ doing preview) are now blocked on google's side. That's why I asked here because there doesn't seem to be any way to access a formatted document at the moment.
    – Michael
    Mar 28 '19 at 14:59
5

How I found out

Disclaimer: Unless you wanna learn how I found out about this trick, skip to the next section.

I was looking at this StackExchange question for inspiration on how to do such a thing the other day and now I've found out how to do it.

Since the HTML displayed on your browser must contain the raw/unparsed Google Doc, there must be a way to do this.

I started with my investigation by copying the HTML code that is rendered inside the viewing box (the <div> shown in the screenshot). Just use Ctrl. + Shift + C and then click on it when the entire editing section is blue.

Sorry. I am using a blank Doc.

My first thought was to paste it into an HTML page and render it without any of the other CSS stylesheets Google loads. Lots of features are rendered weirdly without any of the stylesheets.

Since that didn't work, my second thought was to paste the exact thing into another Google Doc that you own. Brilliant! Now all the CSS that are needed for rendering the code is already loaded and it saves us a lot of work.

Now, you have the document that you can print, copy, or export/save from!!!

TL;DR (ie. How to do it)

Step 1. Load the Doc

Step 2. Open Inspect Element (Ctrl. + Shift. + I OR just use F12)
Step 3. Click on the button shown in the image below so you can select an element that is displayed (look at the top-left corner of the Inspect Element / Developer Tools)

Step 4. Select the <div> tag as shown:

Step 5. Look in the Inspect Element toolbar. A <div> should be highlighted in blue. Click on it to put it into focus and then copy the element.

Step 6. Make a new Doc that you own

enter image description here

Step 7. Repeat steps 2-4 for the new Doc, until you find the <div> tag.

Step 8. Right click on it, then click edit as HTML. Replace everything in the text box with what you copied from the other Doc.

Step 9. Close out of the Inspect Element. Now, you have a Doc that you own (to save it, make a small edits, and then it will autosave in your Drive)

Possible Errors

If you get this error:

Google Drive Unable to Load File Error

  1. Open Inspect Element with F12 or Ctrl. Shift I again.
  2. Use the select button to select the popup.
  3. Delete the element that is highlighted in the Inspect Element menu.
  4. Repeat the process with the dark backdrop, and this annoying blue popup.

Annoying Blue Popup Screenshot

1

I used Chrome's distiller on a doc (haven't tested spreadsheets). I was able to copy the text from there, though it did mess up the formatting a bit.

1

A simple option. In the URL, erase the text after the last forward slash and replace it with "preview". For example, "/edit#gid=93738036" becomes "/preview". Then copy and paste the text into another Google sheet.

1

Yet another option: Enter the URL into https://outline.com/. At the time of writing, URLs ending in /edit are working, if google ever patches this I'd recommend trying to replace /edit with /mobilebasic.

0
  1. Change the end of the document URL from /edit to /mobilebasic.
  2. Disable JavaScript for all sites( re-enable after you are done copying)
  3. Keeping the console open, reload the page.
  4. Ctrl+A + Ctrl+C
  5. Open new doc and CTRL+V

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.