在 IE 中分叉或复制用户浏览器会话
是否可以在 Internet Explorer 插件中分叉用户会话(或执行类似操作)?
我想处理用户单击工具栏中的按钮时所在的页面。 为了避免中断用户浏览,我想“复制”所有内容,以便可以在后台解析和处理页面。 处理过程可能涉及加载 Google 搜索结果链接的内容(如果按钮被点击的地方)等。
所以 - 我基本上想要的是模仿 Ctrl+N 但对用户隐藏窗口,这样他们就不会被打断。
如您所见,如果您在 http://www.snee.com/xml/crud/posttest.html" rel="nofollow noreferrer">http://www. snee.com/xml/crud/posttest.html 并按 Ctrl+N,发布的所有内容仍会出现在新窗口中,但不会出现将数据发布两次。
我正在考虑以某种方式复制 IWebBrowser2
,但是:
- 我不确定这是否可能(我在 MSDN 上找不到任何信息)
- 我不知道它是否复制会话以及。
创建 IWebBrowser2
的新实例并简单地导航到当前 URL 并不是一个有效的解决方案,因为 POST
变量当然不会被保留。
Is it possible to fork a users session (or do something similar) in a Internet Explorer plugin?
I want to process the page the user is on when they click a button in the toolbar. To avoid interrupting the users browsing, I'd like to "copy" everything so I can parse and process the page in the background. The processing can involve things such as loading the content of the result links on a Google search, if that's where the button was clicked.
So - what I basically want is to imitate Ctrl+N but hide the window from the user, so they won't be interrupted.
As you can see, if you fill out and submit the form on http://www.snee.com/xml/crud/posttest.html and press Ctrl+N, everything posted will still appear in the new window, but it won't post the data twice.
I was thinking of somehow copying the IWebBrowser2
, but:
- I'm not sure if that's possible (I haven't been able to find any information on MSDN)
- I don't know if it copies the sessions as well.
Creating a new instance of the IWebBrowser2
and simply navigating to the current URL isn't a valid solution as POST
-variables of course doesn't get carried over.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
BHO 或插件就可以了。
获取源代码的选项有很多,有点多。 选择你的姿势。
查找 IDocHostUIHandler 以改变行为。 IHTMLElementCollection 用于解析浏览器中的页面。
我目前能想到的最简单的事情是......
将当前内容保存到流中。 与获取/查看源代码相同。
您提供浏览器和流媒体。HTH
--
Michael
A BHO or plugin would work.
There are so many options to get the source, it's kinda. pick your poising.
Look up IDocHostUIHandler to alter behaviour. IHTMLElementCollection to parse the page in browser.
The easiest thing I can think of at the moment is....
Save the current contents to a stream. same as get/view source.
You supply the browser and stream.HTH
--
Michael
有趣的想法。 您可以复制 DOM holus-bolus,然后用副本替换新窗口的 DOM 吗? 这只是一个猜测。 此时我和你一样陷入黑暗。
Interesting thought. Could you copy the DOM holus-bolus and then replace a new window's DOM with the copy. It's just a guess. I'm as much in the dark as you at this point.
我认为这是不可能的,因为你必须考虑很多细节,总会有一些事情被打破。 仅提两点:
因此,实时处理是捕获用户所见状态的唯一真正解决方案; 如果这是您想要实现的目标。 如果您不需要那么多细节,可能会更容易做到。
I think it is impossible to do because you have to think about so many details, something will always break. Just to mention two:
So processing live is the only true solution to capture the state as the users sees it; if this is what you want to achieve. If you don't need so much detail it might be easier to do.