Preventing Users from Downloading Javascript and Images
A lot of times I see that resource XXXXX.gif
or XXXXX.js
can’t be saved when I try to save a webpage in Firefox.
So this made me think, can I implement a similar thing for my website as well?
Basically, I am interested in knowing what prevents a resource from being saved locally, but while still allowing the browser to load it?
If it has been loaded into the browser, it has been downloaded to your computer’s memory. The webpage might attempt to stop you from saving an image (by e.g. disabling right click?) or similar, but if you go into the source of the webpage, you should always be able to find the location of the image or the .js
file; if you can load it into the browser, I’m pretty sure you can’t block it from being accessed as such and therefore saved. If nothing else, you could scour your computer’s temporary files to find the file you’re looking for.
I know this isn’t really an answer to your question (‘How can I stop people doing this’), but I think necessary to point out.
Think about this: if you can’t download it, how can the browser display or execute it?