是否可以限制书签?
例如,如果我的网站中有一个小书签可供用户执行某些操作,是否可以将其使用限制为注册用户?我的意思是,任何人都可以将小书签拖到他们的书签栏中,但是我们可以使用系统将小书签功能限制为注册用户吗?例如,用户将小书签拖到栏中,然后他/她尝试执行它,但小书签以某种方式检查该用户是否在网站中注册,如果没有,它会要求用户名和密码......类似的事情。
你能帮忙吗?
for example, if I have a Bookmarklet in my site that let's users do something, is it possible to restrict it's use to Registered users? I mean, anyone can drag a Bookmarklet into their bookmarks bar, but can we use a system to restrict bookmarklets functions to Registered users? For example, a user drags the bookmarklet into the bar and then he/she tries to execute it, but the bookmarklet somehow checks if this user is registered in the website and if not, it asks for username and password... Something like that.
Can you help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果小书签可以执行您未授权用户执行的操作,那么您就会遇到严重的安全问题。
小书签可以使用 JavaScript 执行任何操作,因此请关注您的安全性并不要打扰小书签。即使您可以屏蔽小书签,您会如何处理像 Greymonkey 这样的东西?
If a bookmarklet can do something you haven't authorized to an user, then you have a heavy security problem.
The bookmarklet can do anything with javascript, so focus on your security and leave the bookmarklet alone. Even if you could block the bookmarklet, what would you do with something like greasemonkey?
JavaScript 可以做任何你想做的事情,包括调用 Web 服务来检查用户是否登录……但是客户端发生的任何事情都可以复制和编辑(例如覆盖授权检查)
The JavaScript can do whatever you like, including calling a web service to check if the user is logged in… but anything that happens client side can be duplicated and edited (e.g. to override the authorisation check)