简体   繁体   English

FF扩展XUL图像显示

[英]FF extension XUL image display

If I want to show an image in my sidebar. 如果要在侧边栏中显示图像。 How can I do that? 我怎样才能做到这一点? I tried to do the following to no avail: 我尝试执行以下操作无济于事:

According to this: https://developer.mozilla.org/en/XUL_Tutorial/Adding_Labels_and_Images 据此: https : //developer.mozilla.org/en/XUL_Tutorial/Adding_Labels_and_Images

If I add this code into my ff-sidebar.xul file: 如果我将此代码添加到ff-sidebar.xul文件中:

XUL:
 <image id="image1"/>

Style Sheet:
 #image1 {
   list-style-image: url("chrome://findfile/skin/banner.jpg");
 }

The Image should be displayed. 应显示图像。 Did I pick the wrong file? 我选错文件了吗?

best, US 最好,美国

That's an example if your extension is registered in chrome with findfile: 这是一个示例,如果您的扩展程序在chrome中使用findfile注册:

These images come from within the chrome directory, in the skin for the findfile package.Because images vary by theme, you would usually place images in the skin directory. 这些图像来自chrome目录中的findfile程序包的皮肤。由于图像因主题而异,因此通常将图像放在皮肤目录中。

And in introduction to the tutorial it says: 并且在本教程的介绍中说:

This tutorial will demonstrate creating a simple find file user interface, much like that provided by the Macintosh's Sherlock or the find file dialog in Windows. 本教程将演示如何创建一个简单的查找文件用户界面,非常类似于Macintosh的Sherlock或Windows中的查找文件对话框所提供的界面。

So that example is in the context of the tutorial. 因此,该示例在本教程的上下文中。

You need to provide it an image in your skins folder and in css use: 您需要在skins文件夹中以及在CSS使用中为其提供图像:

list-style-image: url("chrome://yourext/skin/yourfilename.jpg");

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

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