Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
abdullah alhashmi
1,222 PointsIs there a way to disable ctrl +U to block people from viewing source code??
Is there a way to disable ctrl +U to block people from viewing source code??
2 Answers
Jayden Spring
8,625 PointsNo, you cant prevent client side key mappings as this is done by the application itself. All you can do is a redirect so the source which will be shown is that of another page.
To be honest, hiding source is quite pointless. If you really want to hide it there are plenty of HTML and JavaScript obsfucators out there.
Marcus Parsons
15,719 PointsAnd even obfuscators really do nothing because there are plenty of HTML/CSS/JS beautifiers on the web that can easily de-obfuscate code and make it readable again.