更改 Chrome 状态栏中显示的 URL
当我将鼠标悬停在 Chrome 中的某个网址上时,该网址会显示在 Chrome 状态栏中。就我而言,这会导致丑陋的 javascript:bla-bla-bla 引用。当您将鼠标悬停在链接上时,有什么方法可以更改状态栏的内容吗?
谢谢
When I hover over a url in Chrome, the url is displayed in the Chrome status bar. In my case this results in an ugly javascript:bla-bla-bla reference. Is there any way to change the contents of the status bar when you hover over a link?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
尽管您选择了答案,但这个想法是另一种选择。
您可以更改
mouseover
上的href
属性来影响状态栏的显示内容,然后在mouseout
或click
上将其更改回来代码>:Although you selected your answer, this idea is an alternative.
You can change the
href
attribute onmouseover
to affect what the status bar says, and change it back onmouseout
orclick
:我很确定出于安全原因这在任何浏览器中都是不可能的。否则,钓鱼网站的链接将变得非常非常难以检测,因为攻击者只需在状态栏中放置一个真实的 URL,而危险链接实际上会指向其他地方...
请为您的超链接使用 onclick 事件处理程序,并放置一个
href
属性中真实、有意义的 URL 代替javascript:
链接(即使该链接仅用于 JavaScript)。I'm pretty sure for security reasons this isn't possible in any browser. Otherwise links to phishing sites will become much, much harder to detect, because attackers can then just place a genuine URL in the status bar while the dangerous link actually leads elsewhere...
Use an onclick event handler for your hyperlink instead, and put a real, meaningful URL in the
href
attribute in place of thejavascript:
link (even if the link is meant to be used only with JavaScript).我猜您的意思是您想要更改所选链接显示的目的地?在这种情况下,您很可能应该在 href 属性中放置漂亮的 url,并为您的 javascript 使用 onclick 属性。不确定是否可以通过将 javascritp 放入 href 来复制所做的一切。
I guess you mean you want to change what destination is shown for link that is selected? In that case you most likely should put nice url in href attribute, and use onclick attribute for your javascript. Not sure that you can duplicate everything what is done by putting javascritp in href.
假设这就是你所拥有的:
链接
添加
href="#"
到其中。那么应该显示#
而不是javascript:blabla
。所以就像这样:
链接
Assuming this is what you have:
<a onClick="blabla">Link</a>
Add
href="#"
to it. Then the#
should be shown in stead of thejavascript:blabla
.So that would be like this:
<a href="#" onClick="blabla">Link</a>
绝对可以达到想要的效果。只要看看谷歌在其搜索结果状态栏中显示的内容即可。
但是,您需要使用某种技巧,例如像 BoltClock 建议的
onclick
。Google 会向您显示您希望看到的内容 - 一个简单、干净的 URL。
然而,在下面,他们使用带有监控参数的长重定向 URL,在您单击任何结果链接时跟踪您。通过这种方式,谷歌可以监控哪些搜索结果被点击,哪些没有被点击。
不幸的是,大多数人没有意识到这一点。坦白说,我很高兴看到一个浏览器扩展能够消除所有这些肮脏的伎俩,并用“真实的”URL 替换“跟踪”URL。
It is definitely possible to achieve the desired effect. Just look at what Google puts in the status bar of its search results.
However, you need to use some kind of a trick, e.g.
onclick
like BoltClock suggested.Google shows you what you would like to see - a plain, clean URL.
Underneath, however, they use a long redirect URL with monitoring parameters to track you down as you click any result link. That way Google monitors which of the search results are clicked on and which are not.
Unfortunately, most people do not realize that. Quite frankly, I would be very glad to see a browser extension which takes all this dirty tricks down and replaces "tracking" URLs with the "real ones".