Google Drive – How to Copy from a Protected Google Doc

google docsgoogle-drive

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?

Best Answer

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