BHO跨域Cookie处理C# [英] BHO Cross Domain Cookie Handle C#

查看:152
本文介绍了BHO跨域Cookie处理C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我们正在开发BHO IE扩展。

需要实现的功能:

BHO将显示div /框中包含"登录"任何已加载页面上的按钮(例如youtube.com)。 

点击"登录"按钮它会在新标签中打开一个特定的网址。用户将登录新打开的指定网址。
将为新打开的指定网址设置cookie.bookie将被bho读取并且bho将显示"Pin"。

按钮而不是"登录"按钮按钮。点击"Pin"按钮将处理按钮api呼叫。



使用的方法:

使用"DWebBrowserEvents2_DocumentCompleteEventHandler" "IWebBrowser2"的处理程序和文档。我们已经阅读了指定网址的cookie和
,我们使用javaScript将其保存在localStorage中。因为localStorage是特定于域的,我们无法在第一个网址上读取cookie的
值(或者tab)我们执行BHO.Please帮助我们处理这个问题。



尝试的解决方案:

1.在setite方法中使用windowstatechanged事件处理浏览器标签更改 

但此事件未在IE上触发。



2.在setite方法中使用OnVisible事件来处理浏览器标签更改 

但此事件未在IE上触发。



是否有任何解决方案可以实现上述功能?(需要保存浏览器级别的cookie并访问它并在到期时更新它)

请告诉我如何处理相同的内容。

Hi,
We are developing BHO IE extension.
Functionality need to be implemented :
BHO will show div/box contain "Login" Button on any loaded page(ex. youtube.com). 
On click of "Login" it will open a specific url in new tab.User will login on new opened specified url
that will set cookie for newly opened specified url.Cookie will be read by bho and bho will display "Pin"
button instead of "Login" button.On click on "Pin" Button api call will be handled.

Used approach :
Using "DWebBrowserEvents2_DocumentCompleteEventHandler" handler and document of "IWebBrowser2" we have read cookie of specified url
and we saved it in localStorage using javaScript.Beacause localStorage is domain specific,we are unable to read cookie
value on first url (or tab) where we executed BHO.Please help us to handle this problem.

Tried solutions :
1. Used windowstatechanged event in setsite method to handle browser tab change 
but this event is not firing on IE.

2. Used OnVisible event in setsite method to handle browser tab change 
but this event is not firing on IE.

Is there any solution to implement above mentioned functionality?(Need to save cookie at browser level and access it and update it on expire)
Please let me know how to handle the same.

谢谢

推荐答案

增强保护模式已通过def打开互联网安全区域网站奥尔特。这意味着网站将在不同的流程中运行,并且通过在AppContainer完整性级别运行,它们彼此隔离。不同的AppContainer之间不共享缓存,cookie和其他
web平台状态信息。因此,默认情况下,如果要在运行不同网站的选项卡之间共享,则无法在浏览器中保存状态信息。 

Enhanced Protected Mode is turned on for internet security zone web sites by default. That means web sites will be ran in separate processes and they are isolated from each other by running at the AppContainer integrity level. Cache, cookies, and other web-platform state information are not shared between different AppContainers. Thus by default you can't save state information in the browser itself if you want to share between tabs running different web sites. 

支持EPM

1您的BHO需要在客户的计算机上安装32位和64位版本

1 your BHO needs to install both 32 bit and 64 bit versions on customer's computer

2您的BHO需要在CATID_AppContainerCompatible类别下注册

2 your BHO needs to register under the CATID_AppContainerCompatible category

3你的BHO需要注册经纪人流程在中等完整性级别
下运行,以促进不同选项卡中BHO实例之间的通信。对于进程间通信对象(例如共享内存或命名管道),您需要

相应地授予访问权限

3 your BHO needs to register a broker process that runs at Medium integrity level to facilitate communication between your BHO instances in different tabs. For inter-process communication objects (e.g. shared memory or named pipes) you need to grant access accordingly.


这篇关于BHO跨域Cookie处理C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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