eoger / tabcenter-redux

Vertical Tabs extension for Firefox
Mozilla Public License 2.0
379 stars 67 forks source link

Custom Image Support #336

Closed zeroibis closed 6 years ago

zeroibis commented 6 years ago

Would be nice to be able to use some simple code such as:

#tablist {
  background-color: hsl(var(--tab-background-normal));
}

body.dark-theme {
    background-image: url("myimg.img");
    background-position: center bottom;
    background-repeat: no-repeat;
}

However, there is no clear way to reference the location of the image.

Using a web url works great but it would be ideal to be able to place the image on the computer directly.

From my current understanding on how images load in the addon right now the only way to directly add images is to repackage it.

My hope is that perhaps there is some easy way to be able to support users custom images to do all sorts of mods without needing to repackage but instead by simply placing the files in a given folder and referencing them as needed.

JostCrow commented 6 years ago

can't this be done using 'file://' paths?

zeroibis commented 6 years ago

I tired that placing the image on my root C drive using

background-image: url("file://C:/myimg.img");

Maybe I did something wrong?

JostCrow commented 6 years ago

Can you try 3 slashes after file:?

From answer 2: https://stackoverflow.com/questions/24208607/how-do-i-use-a-local-file-as-a-background-image-with-css

zeroibis commented 6 years ago

Tried: background-image: url("file:///C:/megumin.png");

Image does not load.

JostCrow commented 6 years ago

Ok. Then I don't know

Smile4ever commented 6 years ago

It's a security feature of Firefox. Extensions may not load content to file:// URLs. You have to host the images either on a local or remote webserver, or extend Tab Center Redux to store the images loaded by a filepicker using IndexedDB.

zeroibis commented 6 years ago

Luckily, I have a webserver but I feel bad for the users who do not lol.

Too bad there is no way to load an image from for example the chrome folder where userChrome.css is.

Smile4ever commented 6 years ago

Users can always install Apache or a combination package like XAMPP to get a webserver on their local machine.

eoger commented 6 years ago

Looks like this is fixed, closing.