在同一个浏览器标签页中打开链接

在同一个浏览器标签页中打开链接

问题描述:

我如何打开在同一个浏览器标签页的链接?我想这code:

How do I open a link in the same browser tab? I tried this code:

ShellExecute(Handle, 'open', 'http://site.com', '_self', nil, SW_SHOWNORMAL);

但它继续在一个新的表,打开该链接。

But it continues to open the link in a new table.

感谢。

我已经之前写的关于这个主题:

I've written on this topic before:

的ShellExecute 完全没有概念的标签。事实上,这不
  甚至有一个概念默认浏览器。它所做的就是找​​到什么
  程序被配置为,与开始的文件名的http://和
  执行所设置的命令行。

ShellExecute has absolutely no notion of "tab." In fact, it doesn't even have a notion of "default browser." All it does is find whatever program is configured for file names that start with "http://" and execute the configured command line.

与新的命令行浏览器什么是它自己的选择。
  该API函数没有控制权。有时候,浏览器允许
  用户可以配置它。

What the browser does with the new command line is its own choice. The API function has no control. Sometimes, the browser allows the user to configure it.

打开一个新的标签或窗口是最安全的做法。无论是你
  也不是浏览器知道用户是否仍然使用previous
  标签或窗口。

Opening a new tab or window is the safest thing to do. Neither you nor the browser knows whether the user is still using the previous tab or window.