更改运行Firefox的配置文件的图标 [英] Change icon of running firefox profile

查看:167
本文介绍了更改运行Firefox的配置文件的图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Win7,但寻找一个跨操作系统解决方案,但是这甚至没有在我的Win7中工作。我正在尝试更改当前配置文件的图标。所以我做的是:


  1. 我创建了firefox.exe的快捷方式并将其移动到我的文档中

  2. 右键点击这个快捷方式,然后更改图标

  3. ,但在Firefox中,任务栏显示正常的Firefox图标,左上角的图标也是如此(参见附图plz) $ b

如何更改此图标?

谢谢


这里是另一个话题,我在ask.mo试图问同样的事情: https://ask.mozilla.org/question/725/custom-icon-per-profile/

解决方案

<如果你的目标是动态地 ,那么你的问题的标题和你的问题的文本的结合使得它不清楚你想要完成什么。 / em>更改curr的窗口图标如果你的目标是总是

如果你的目标是 ,那么你需要按照第二个或第三个方法列出nmaier的答案。 / em>有一个不同的静态图标,用于特定配置文件的主要Firefox窗口,这很容易。



您将需要适当格式的图标文件每个架构你希望这个工作。

以下假定Windows,它很容易扩展到其他体系结构,包括一个同名的图标文件,但适当的文件扩展名和格式。



创建一个简单的覆盖图提取的扩展名。您至少需要2个文件:


  1. < extension-dir> instal.rdf

  2. < extension-dir> \ chrome\icons\default\main-window.ico

,install.rdf:

 <?xml version =1.0?> 
xmlns:em =http://www.mozilla。组织/ 2004 / EM-RDF#>
<描述about =urn:mozilla:install-manifest>
< em:id> window-icon-change@nowhere.foo< / em:id>
< em:version> 1.0.0< / em:version>
< em:name>窗口图标变更< / em:name>
< em:description>更改Firefox主窗口图标。< / em:description>
< em:creator> Makyen< / em:creator>
< em:解包>真< / em:解包>
< em:targetApplication>
<说明>
< em:id> {ec8030f7-c20a-464f-9b0e-13a3a9e97384}< / em:id>
< em:minVersion> 3.0a1< / em:minVersion>
< em:maxVersion> 43.0a1< / em:maxVersion>
< /说明>
< / em:targetApplication>
< /说明>
< / RDF>

注意:< extension-dir> \ chrome\icons\default\ 目录不同于nmaier响应中的目录。在这个答案中,图标和默认目录颠倒过来,将不起作用。

您可能需要一个额外的文件:

< extension-dir> chrome.manifest

chrome.manifest文件不是必需的。然而,没有它可能会导致单行打印到错误/浏览器控制台(如果你甚至打开)。如果chrome.manifest文件存在,即使长度为零,控制台中也不会有文件无法读取的投诉。



安装扩展。简单的做法是用这三个文件创建一个zip文件;然后将文件扩展名更改为.xpi;然后将其拖放到一个Firefox窗口中,运行您希望安装的配置文件。

您可以将其扩展为包含您希望的任何子窗口的图标。您将需要确定每个子窗口的ID。图标文件名称就是您所需架构中带有适当图标扩展名的窗口ID。 main-window只是主浏览器窗口的ID。



创建一个扩展来测试这个过程不到5分钟。您可以很容易的完成这个任务。



这里假设没有一个自定义的主窗口图标(Windows,默认安装位置):
C:\程序文件\Mozilla Firefox \ browser \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

如果扩展名是重新启动或者不提供,这将不起作用。



你可以找到一个简短的信息关于MDN上的窗口图标。 nmaier提到文档谈论捆绑。在谈到Mozilla附加组件时,捆绑软件是您的附加组件。 $ b

图标文件位于(Windows):
< profile dir> \extensions \< extension -dir> \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'\\

根据评论中的讨论,我创建了一个Firefox附加组件,允许设置配置文件的窗口图标。在评论中提到的5分钟附加组件上扩展了很多。添加完全在用户界面中,用于选择要使用的图标并将其分配给Firefox打开的各种不同窗口的选项对话框。您可以从 更改个人资料的窗口图标


I'm using Win7 but looking for a cross os solution, but this isnt even working in my Win7. I'm trying to change the icon of just the current profile. So what i did was:

  1. I created shortcut of firefox.exe and moved it to my documents
  2. right click on this shortcut and then changed icon
  3. but in firefox the taskbar shows normal firefox icon and so does the top left icon (see attached image plz)

How can I change this icon?

Thanks

Here's another topic i made on ask.m.o trying to ask the same thing: https://ask.mozilla.org/question/725/custom-icon-per-profile/

解决方案

The combination of the title of your question and the text of your question make it unclear what you desire to accomplish.

If your goal is to dynamically change the window icon of a currently running Firefox process then you will need to follow something along the lines of the second or third method listed in nmaier's answer.

If you goal is to always have a different, static icon used for the primary Firefox windows for a specific profile, that is quite easy.

You will need icon files of the appropriate format for each architecture for which you desire this to work.

The following assumes Windows, it is easily expanded to other architectures by including an icon file with the same name, but appropriate file extension and format.

Create a simple overlay, extracted extension. You will need a minimum of 2 files:

  1. <extension-dir>instal.rdf
  2. <extension-dir>\chrome\icons\default\main-window.ico

Example, fully functional, install.rdf:

<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
    <Description about="urn:mozilla:install-manifest">
        <em:id>window-icon-change@nowhere.foo</em:id>
        <em:version>1.0.0</em:version>
        <em:name>Window icon change</em:name>
        <em:description>Change the Firefox main window icon.</em:description>
        <em:creator>Makyen</em:creator>
        <em:unpack>true</em:unpack>
        <em:targetApplication>
            <Description>
                <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
                <em:minVersion>3.0a1</em:minVersion>
                <em:maxVersion>43.0a1</em:maxVersion>
            </Description>
        </em:targetApplication>
    </Description>
</RDF>

NOTE: The "<extension-dir>\chrome\icons\default\" directory is different than the one in the response by nmaier. In that answer the "icons" and "default" directories reversed and will be non-functional.

You will probably want an additional file:
<extension-dir>chrome.manifest
The chrome.manifest file is not required. However, not having it may result in a single line being printed to the error/browser console (if you even have that open). If the chrome.manifest file exists, even if zero length, there will be no complaint in the console that the file could not be read.

Install the extension. The easy way to do this is to create a zip file with those three files; then change the file extension to .xpi; then drag and drop it onto a Firefox window running the profile in which you desire it to be installed.

You can expand this to include icons for whatever sub-windows you desire. You will need to determine the ID for each sub-window. The icon file name is just the window ID with the appropriate extension for an icon in the architectures you desire. "main-window" is just the ID for the main Firefox browser window.

Creating an extension to test this took less than 5 minutes. You should find it reasonably easy to accomplish.

This assumes that there is not a custom main-window icon located at (Windows, default install location):
C:\Program Files\Mozilla Firefox\browser\chrome\icons\default
as that directory is for all profiles and is searched first.

This will not work if the extension is either restartless or extractionless.

You can find a brief amount of information about window icons on MDN. nmaier mentions the docs talking about bundles. When talking about Mozilla add-ons, a bundle is your add-on package.

The icon file(s) will be at (Windows):
<profile dir>\extensions\<extension-dir>\chrome\icons\default*
Once the extension is installed, you can change it/them manually without re-installing, if desired.

Based on the discussion in the comments, I created a Firefox Add-on to allow setting the window icons for the profile. It is much expanded upon the 5 minute add-on mentioned in the comments. The addition is entirely in a UI for the options dialog for selecting the icon to use and assigning it to the various different windows Firefox opens. You can get it from Mozilla Add-ons under Change Profile's Window Icons.

这篇关于更改运行Firefox的配置文件的图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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