My requirement is to disable the print screen command when the user taps the print screen button on the keyboard. I can do this in Internet Explorer, but how can I do this in Chrome and other browsers?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
Whatever you're trying to do, I'd wager it won't work.
You can add in all sorts of client-side controls to prevent users from copying content, but the fact remains that in order to view your content in the first place, users have to download it off of your servers and onto their machine, where it is no longer under your control.
At best, you may frustrate a user until they lose interest in copying your content. At worst, your efforts may harm the usability of your site, especially for users with handicaps/accessibility issues. But if someone really wants to copy your content (e.g. they are financially motivated to steal it), you cannot stop them. There are too many ways to copy content from a webpage, such as other key commands that don't use the print-screen button, 3rd party screen-grab tools, or simply reading the page source with dev-tools.