开发者

Rails dont allow to open another copy of page

开发者 https://www.devze.com 2023-03-01 04:05 出处:网络
I have for example page , and if i copy url and paste in another tab there will be the same page. Ok, this is okey, but i dont want this. Can i make that, if I open in another tab (second, or third) t

I have for example page , and if i copy url and paste in another tab there will be the same page. Ok, this is okey, but i dont want this. Can i make that, if I open in another tab (second, or third) the same url there wil开发者_开发技巧l be flash error and write something like: "Sorry you can open only in 1 tab"?


No, you can't check if page is already opened in browser with Ruby-on-Rails.

I am not sure if you can do it with javascript.

What you can do is to save last_visit time to page and deny to reload it or load anywhere else for current user for particular time: 1 minute, 10 minutes.

0

精彩评论

暂无评论...
验证码 换一张
取 消