【发布时间】:2016-01-30 16:51:00
【问题描述】:
关于GoBack 方法,我遇到了TWebBrowser 的问题。以下是显示问题的导航历史记录:
[1] htt#://www.google.com/
[2] htt#://news.google.com/nwshp?hl=en&tab=wn
[3] htt#://news.google.com/news/url?sr=1&ct2=us%2F0_0_s_3_1_a&sa=t&usg=AFQjCNGgo-FdxdVP4AVI_HZEV7gS66cjDA&cid=43982236066804&url=http%3A%2F%2Fnews.cnet.com%2F8301-10805_3-57613303-75%2Fmicrosoft-provides-doctors-note-for-sick-xbox-one-gamers%2F&ei=ORaOUvjjJciMgQeGwAE&rt=HOMEPAGE&vm=STANDARD&bvm=section&did=2559730436932654466&ssid=tc
[4] htt#://news.cnet.com/8301-10805_3-57613303-75/microsoft-provides-doctors-note-for-sick-xbox-one-gamers/
到达#4 后,我执行GoBack 过程。这就是问题发生的时候。 GoBack 从历史列表中删除 [4] 并转到 [3] 不幸地重新加载 [4] 有效地取消了 GoBack 请求。
我想要的是允许 [3] 启动 [4] 但阻止自己留在堆栈上,以便堆栈看起来像这样:
[1] htt#://www.google.com/
[2] htt#://news.google.com/nwshp?hl=en&tab=wn
[3] htt#://news.cnet.com/8301-10805_3-57613303-75/microsoft-provides-doctors-note-for-sick-xbox-one-gamers/
我该怎么做?
【问题讨论】:
-
到 twebbrowser.onbeforenavigate2 你可以设置 Cancel:=false; - 中止当前导航 .` if (pos('news.google.com/news/url',url)>0) then begin Cancel:=false; goback + 1个网址`结束。如果对我的回答有帮助,请投票?我会很高兴:)
标签: delphi twebbrowser