Hide Javascript code on browser

Hello all,

at the moment if i type a specific URL of my web app into a browser like www.example.com/js/jsfile.js it displays the entire code of the JS file.

Is there any way to restrict such files from viewing, without causing any trouble to caching?

Not really. You could check referrers and things like that with a Worker, but why would you want to do this?

Anyone viewing your site will download that script and can grab it from their dev tools or wherever. You’re not protecting anything by doing this.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.