1

I have a blank Firefox Add-On I made using the Getting Started Tutorial. When I run my extension using jpm run I observe the following.

If I navigate to any image it appears like this (image is displayed nicely in the centre):

enter image description here

However, I have the same image store in my extension under: ./data/test.jpg. When I navigate to resource://my-addon/data/test.jpg I get the following blank page:

enter image description here

The image is there, because if I hover over it in the inspector, it shows: enter image description here

Am I doing something wrong, missing something in the docs about rendering images or is there a bug with how images are being rendered from the extension?

LondonAppDev
  • 8,501
  • 8
  • 60
  • 87

1 Answers1

0

Include the self and then do

console.log(seld.data.url(''))

This will give you the id of your addon. It is very likely not my-addon it will be something like: jid1-4GP7z3tkUd3Tzg@jetpack - so your path to your image will be resource://jid1-4GP7z3tkUd3Tzg@jetpack/data/test.jpg.

Noitidart
  • 35,443
  • 37
  • 154
  • 323