Can't copy text from web tutorial code samples

I’ve tried Chrome, Safari, Firefox, print as PDF, Save As HTML, nothing I do allows me to copy text from the final code sample box on this page, on a Mac: Learn game development w/ Unity | Courses & tutorials in game design, VR, AR, & Real-time 3D | Unity Learn

I can’t get it from the source either, as the source is mangled with HTML table elements in order to implement the syntax highlighting…

1 Like

Same here. This is insane for a CODE TUTORIAL?! How long has it been broken like this?

1 Like

Workaround (on windows in Chrome Browser): select all the code, right-click, print. In the print preview you can select all the code and you can copy it from there.

1 Like

Same problem, makes it much harder to follow the tutorials

This is not a bug, but an intentional function.
Copying is a standard OS & Browser function. And you need to take some actions (in javascript) to prevent its work.
Some not too smart person thinks this is for good or just sabotages.

1 Like

same here

absolutely ridiculous, this is a bug and there is no other way about it!
does not work in incognito too, copying and pasting a new text file thinking is a windows problem or something, such a time waster, hate it

1 Like

meanwhile, i just select all the code and then left click and then search google for then copying from google`s input tab

Same here, like really? Unity? Tutorial? Prevent copy+paste?

It’s by design. They block copy and paste, it’s really frustrating!

If you use Chome you can install an extension like this one. I’m sure there will be others for Firefox etc.

2 Likes

I just wanted to take some personal notes but couldn’t copy and paste it. Writing notes manually is very exhausting especially with one monitor…

Thx Aeldron;
for FireFox use the Extension “Copy Plain Text”
works like a Charm

Go to Browser > Developer Tools > Console and paste the following code to get the complete Script

const codes = […document.querySelectorAll(‘code’)]
codes.forEach(code => {
const text = code.innerText
console.log(text)
})