How can we restrict the user from saving a web pag

2019-06-22 06:11发布

How can we restrict a user from saving the page?

Please provide some tips to disable File->Save and View Source options

EDIT: Obviously it can't be done, and probably shouldn't be attempted. But possibly a more interesting variant on this question is how can we make is sufficiently hard for a user to save a page in a usable format such that it is not worth their while doing so? The question doesn't pose a value, but say we were protecting an article subscription site where the user is paying a few hundred dollars per annum for continued access to text.

11条回答
甜甜的少女心
2楼-- · 2019-06-22 07:00

I'd like to add one more method which, imho, is hard to circumvent: Ctrl+S! (for me, Apple+S)

查看更多
Deceive 欺骗
3楼-- · 2019-06-22 07:02

how can we make is sufficiently hard for a user to save a page in a usable format such that it is not worth their while doing so

Nothing hard: add on every page: "Personal property of John Stealer, company Zetabeta, paid with credit card 756890987654, billing address ..., subscription expires 12/20".

This is an "extended text format" that I just invented... it has an amazing property: though it looks like a regular text, user is much less willing to print it out and give to others...

查看更多
孤傲高冷的网名
4楼-- · 2019-06-22 07:03

Try javascript "encoding" and obfuscation.

Something like

if(document.location == 'mydomain.com') {
  content = getAjax('mycontent.xml');
  // content will hold something like 72, 94, 81, 99, ... - encoded ASCII codes
  document.write(String.fromCharCode(content));
}

It will always be possible to save the page, but for non-technical guys it will be harder to make it work. There are 2 protections

  • domain name
  • converting ASCII

It's only pseudocode, but I think you get the idea.

查看更多
一纸荒年 Trace。
5楼-- · 2019-06-22 07:07

It shouldn't be an issue, but if you really don't want a user from seeing your code (javascript, css or html) for some reason, than you could use some obfuscation tool which makes the code less readable.

查看更多
太酷不给撩
6楼-- · 2019-06-22 07:12

The least you can do is... the content is generated dynamically by Javascript. In that way, they cannot simply save it. Of course, in FX, they can still view the generated code and then copy&paste. however, normally people cannot save the page.

查看更多
登录 后发表回答