使用Javascript或其他方式?检查IE打开的选项卡。 [英] Use Javascript or some other way? Check IE open tabs.

查看:58
本文介绍了使用Javascript或其他方式?检查IE打开的选项卡。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从桌面单击一个快捷方式,将IE打开到特定的站点地址。但是,我希望它能够找到任何打开的IE浏览器窗口并查看是否有任何标签包含此网站地址的一部分,例如* .mycom



多个登录正在杀死我,云应用程序不会限制用户登录尝试。数据库让我的用户感到困惑。



我甚至无法开始决定什么是最好的。我正在寻找一些反馈和一般逻辑 - 而不是代码 - 我可以解决这个问题。 :)

I want to click a shortcut from the desktop that will open IE to a specific site address. However, I want it to look for any open IE browser windows and see if any of the tabs contain a portion of this site address, such as *.mycom

Multiple logins are killing me and the cloud app does not restrict user login attempts. The database gets all confused and so do my users.

I just can't even begin to decide what would be best for this. I am looking for some feedback and general logic - not code - I can figure that out. :)

推荐答案

首先,您无法在IE窗口中查询包含指向您网站的链接的标签。要做到这一点,你可能需要写一个服务。



关于多个登录...在我当前的项目中,我想要像Facebook一样的东西,列出所有您登录的设备并从您想要的设备中注销。你可以把它移植到你的项目。



我使用NoSQL所以逻辑就是这个......



创建登录会话数据库。



当用户登录服务器时,生成登录密钥...我使用浏览器用户代理,用户名和IP地址如此199.199.199。***最后三位数字未使用动态IP地址的原因。


将登录密钥存储在数据库中。



对于所有登录,数据库看起来像这样...



First, you can't query IE window for tabs that contain a link to your site. To achieve that, you might have to write a service.

As regards multiple logins... on my current project, I wanted something like what Facebook has, list all devices you were logged in on and sign you out from the ones you want. You could port that to your project.

I am using NoSQL so the logic is this...

Create a login session database.

When a user logs in to the server, generate a login key... I use the browser user agent, the username and the IP address like so 199.199.199.*** The last three digits are not used cause of dynamic IP addresses.

Store the Login Key in the DB.

For all logins, the DB looks something like so...

Users: {
    "Username1": {
       "logins":[
        {"agent":"Mozilla 3.2","OS":"Windows 2000","IP":"999.999.999.991","loginKey":"Key1"},
        {"agent":"IE8","OS":"Windows XP","IP":"999.999.999.191","loginKey":"Key2"},
        {"agent":"Chrome32","OS":"Chrome OS","IP":"999.999.299.391","loginKey":"Key3"}
       ]
    },
    "Username2": {
      "logins":[
        {"agent":"Safari 7","OS":"Mac OS X","IP":"999.399.999.991","loginKey":"Key1"},
        {"agent":"Safari","OS":"IPhone 5","IP":"999.199.949.191","loginKey":"Key2"}
       ]
    }
}





如果要向用户显示他登录的位置,只需显示其帐户的登录信息。在您的情况下,您可以检查数据库中是否已存在用户的会话密钥,通知他并执行其他操作。



请注意使用SQL基于数据库可能会影响您网站的性能,因为您还需要检查用户是否访问后续页面。或者,您可以在用户仅登录时执行此操作。



When you want to show the user where he is logged in, just display the logins for his account. In your case, you could just check if there is already a session key in the db for the user, inform him and do other things.

Note that using a SQL based db could affect the performance of your website since you'll also need to check if the user visits subsequent pages. Or, you could just do this for when the user logs in only.


这篇关于使用Javascript或其他方式?检查IE打开的选项卡。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆