在同一个浏览器标签页中打开链接 [英] Open link in same browser tab

查看:366
本文介绍了在同一个浏览器标签页中打开链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何打开在同一个浏览器标签页的链接?我想这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.

这篇关于在同一个浏览器标签页中打开链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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