Image in chrome/newtab folder is nor reached by the code
hi, I'm asking for help to solve this inconvenient when I try to replace the default wallpapers in newtab page.
Fist of all I'm using the developer Firefox version that use beta version to do this.
I have activated this preference in about:config page:
browser.newtabpage.activity-stream.newtabWallpapers.enabled to true
after that I replaced the wallpapers thumbnails successfully with the next code:
Sounds like what's happening here is that the relative path you have given doesn't resolve to what you think it does.
See, the variable --newtab-wallpaper-dark is used by an internal style sheet, so when the url() actually gets resolved it will be relative to the internal style sheet address - not to the file path of userContent.css.
So, a workaround would be to give it an absolute file path or override the property where that variable is actually used.
Right, that makes perfect sense. The property being a variable nor it having an important tag are not meaningful to explain what's happening here.
What is important is simply what the address of the .css file is which sets the background-image property, because relative url resolves relative to that. The internal style sheet where this background-image property is set is chrome://activity-stream/content/css/activity-stream.css. So if the url it uses is ../newtab/wallpaper-dark.png (as by you setting the variable as such) then it will try to load an image from address chrome://activity-stream/content/newtab/wallpaper-dark.png which surely doesn't exist.
But if you set background-image property from within userContent.css then the relative url resolves relative to that instead.