简体   繁体   English

有什么简单的方法可以改变地址栏背景?

[英]Is there any easy way to change the address bar background?

I would like to change the address bar background in either Firefox or Internet Explorer to indicate weather I am running the test application or the live.我想更改 Firefox 或 Internet Explorer 中的地址栏背景,以指示我正在运行测试应用程序或实时的天气。 Is there any easy way to do it using HTML, Javascript or ASP.NET?有没有使用 HTML、Javascript 或 ASP.NET 的简单方法?

In Chrome, I use different profiles with different themes to distinguish between two different clients.在 Chrome 中,我使用具有不同主题的不同配置文件来区分两个不同的客户端。 You just need to make sure to use the correct browser for what you're trying to do.您只需要确保使用正确的浏览器来执行您要执行的操作。

basically, set up a link to基本上,建立一个链接

chrome.exe --user-data-dir=[profile dir] chrome.exe --user-data-dir=[配置文件目录]

You can do the same thing in FireFox你可以在 FireFox 做同样的事情

Not at all.一点也不。 Browsers don't expose that kind of UI to pretty much anything except plug-ins.浏览器不会将这种 UI 暴露给除了插件之外的几乎任何东西。 I'd recommend just coloring an element on the page differently depending on the test/production version of the app.我建议根据应用程序的测试/生产版本对页面上的元素进行不同的着色。

it's probably easier to change the body background instead.相反,更改正文背景可能更容易。 I don't think any browser would let you do that.我认为任何浏览器都不会让你这样做。

This is not possible.这是不可能的。 it would be annoying if the website changes the color of your address bar and make it the same color of the text font.如果网站更改地址栏的颜色并使其与文本字体的颜色相同,那会很烦人。

How ever if you want to distinguish your current environment, why don't you simply assign a different Favicon for each versions.但是,如果您想区分当前环境,为什么不简单地为每个版本分配不同的 Favicon。

Can you just put something in the web application itself by using a web.config setting?您可以使用 web.config 设置在 web 应用程序本身中添加一些内容吗?

<html> <html>
<head> <头部>
</head> </head>
<body style="margin:0px 0px 0px 0px;"> <body style="margin:0px 0px 0px 0px;">
<div style="width:100%; top:50px; background-color:red; text-align:center;">--- Production Environment ---</div> <div style="width:100%; top:50px; background-color:red; text-align:center;">--- 生产环境---</div>
</body> </正文>
</html> </html>

在此处输入图像描述

There is only 1 way I can think of and it requires HTTPS.我只能想到一种方法,它需要 HTTPS。 Most browsers now have 3 tiers of certificates: standard from a trusted authority, self signed, and Extended Validation .大多数浏览器现在都有 3 层证书:来自受信任机构的标准证书、自签名证书和扩展验证 If you use different types for testing and live, the address bar will look different.如果您使用不同类型进行测试和直播,地址栏看起来会有所不同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM