简体   繁体   中英

How do I check if firebug is installed with javascript?

Here it is described how to check if Firebug is installed by checking if an image of firebug exists: http://webdevwonders.com/detecting-firefox-add-ons/

But it seems to be a bit outdated, cause the images he uses there don't exist anymore in firebug.

the firebug chrome.manifest looks like:

content firebug content/firebug/ contentaccessible=yes
...

but in the whole addon I only find one png now, and that is placed in the rootfolder of the addon. But some other content is accessible, for example: chrome://firebug/content/trace.js

Ho

So, in gerneral:

How do I make an image accessible that resides inside a Firefox SDK Addon?

I program an Addon and I want to make an image ok.png available to all javascripts in Firefox.

I added the image in the data folder and added a chrome.manifest

content response-timeout-24-hours data/
content response-timeout-24-hours data/ contentaccessible=yes

But no way to call it via a URL like

chrome://response-timeout-24-hours/data/ok.png

How do the paths belong together? which is relative to which?

I created a Bug report here.

So if you want to make your add-on detectable you need another approach:

you can use a PageMod to attach a content script that would wait for a message from your web-app and "respond" by sending another message back to your app. you would know that if you don't receive the response, your addon is not installed. check out the documentation for more details:

https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/page-mod

I used this to make my add-on detectable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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