没有会话共享,避免导航按钮浏览器同时打开的应用程序窗口 [英] No session share and avoid navigation buttons in browser while opening application window

查看:145
本文介绍了没有会话共享,避免导航按钮浏览器同时打开的应用程序窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用VBScript code,打开应用程序窗口,以避免前进/后退导航在打开的用户在 IE8 窗口。

We are using VBScript code to open the application window to avoid users having forward/back navigation while opening the IE8 window.

这是用code。

Set WshShell = CreateObject("shell.application")
Set IE=CreateObject("InternetExplorer.Application")
IE.menubar = 1
IE.toolbar = 0
IE.statusbar = 0
'here we open the application url
IE.navigate "http://www.google.com" 
IE.visible = 1
WshShell.AppActivate(IE)

这工作正常,但问题是,如果用户打开多个窗口的会话cookie翻过窗户共享。

This is working fine, however the problem is that if the user opens multiple windows the session cookies are shared accross the windows.

有关这个也有,同时打开IE浏览器,我们可以使用nomerge选项的解决方案

For this also there is a solution that we can use the nomerge option while opening the IE

WshShell.ShellExecute "iexplore.exe", " -nomerge http://www.google.com", null, null, 1

现在,我们希望这两个选项可用。即用户不应该能够导航向前/向后和如果两个窗口被打开数据不应被共享。

Now we want both these options to be available. i.e user should not be able to navigate forward/backward and also if two windows are opened data should not be shared.

我们没能同时获得这些东西一起工作。

We were not able to get both these things working together.

此外,我们不希望任何全屏模式​​(即后pressing F11)

Also we do not want any full screen mode(i.e after pressing F11)

任何一个可以提供解决方案?

Can any one provide the solution?

先谢谢了。

推荐答案

在由patmortech回答的链接中提到的解决方案并不完美,因为饼干仍然共享即可。当用户在单机打开应用程序两次,使用它创建两个过程的AppToRun变量-nomerge选项。

The solution mentioned in the link answered by patmortech is not perfect, as the cookies were still shared. So used the -nomerge option in the AppToRun variable which creates two processes when user opens the application twice in the single machine.

在IE8中如果有两个互联网探索者打开然后将它们合并成单一的过程,以便它可以打开IE8实例差进程-nomerge选项。

In IE8 if two internet explorers are opened then they are merged into single process so the -nomerge option which opens the IE8 instances in difference processes.

 On Error Resume Next

AppURL = "http://www.stackoverflow.com"
AppToRun = "iexplore -nomerge"
AboutBlankTitle = "Blank Page"
LoadingMessage = "Loading stackoverflow..."
ErrorMessage = "An error occurred while loading stackoverflow.  Please close the Internet Explorer with Blank Page and try again.  If the problem continues please contact IT."
EmptyTitle = ""

'Launch Internet Explorer in a separate process as a minimized window so we don't see the toolbars disappearing
dim WshShell
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run AppToRun, 6

dim objShell
dim objShellWindows

set objShell = CreateObject("Shell.Application")
set objShellWindows = objShell.Windows

dim ieStarted
ieStarted = false

dim ieError
ieError = false

dim seconds
seconds = 0

while (not ieStarted) and (not ieError) and (seconds < 30)

    if (not objShellWindows is nothing) then
        dim objIE
        dim IE

        'For each IE object
        for each objIE in objShellWindows

            if (not objIE is nothing) then

                if isObject(objIE.Document) then
                    set IE = objIE.Document

                    'For each IE object that isn't an activex control
                    if VarType(IE) = 8 then

                        if IE.title = EmptyTitle then
                            if Err.Number = 0 then
                                IE.Write LoadingMessage

                                objIE.ToolBar = 0
                                objIE.StatusBar = 1
                                objIE.Navigate2 AppURL

                                ieStarted = true
                            else
                                'To see the full error comment out On Error Resume Next on line 1
                                MsgBox ErrorMessage
                                Err.Clear

                                ieError = true

                                Exit For
                            end if
                        end if
                    end if
                end if
            end if

            set IE = nothing
            set objIE = nothing
        Next
    end if

    WScript.sleep 1000
    seconds = seconds + 1
wend

set objShellWindows = nothing
set objShell = nothing

'Activate the IE window and restore it
success = WshShell.AppActivate(AboutBlankTitle)

if success then 
    WshShell.sendkeys "% r"  'restore 
end if

这篇关于没有会话共享,避免导航按钮浏览器同时打开的应用程序窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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