extension creates 404 requests for images in css files with relative path
See original GitHub issueThis extension creates a lot of 404 requests on web servers which uses background-images in CSS files with an relative path.
e.g. i have following files:
/test.html
/sub/test.html
/css/style.css
/css/images/background.png
Content of /test.html (for the test.html in sub directory href=“…/css/style.css”
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/style.css">
<title>test in root</title>
</head>
<body>
<div class="my-class">
this should have a background
</div>
</body>
</html>
content of /css/style.css
.my-class {
height:500px;
width: 500px;
display: block;
background: url("images/background.png") repeat scroll 0 0 green;
}
e.g. if i open/test.html
without dark reader enabled:
with dark reader enabled:
the background image is requested 3 times! http://localhost/test/image-test/css/images/background.png (correct path from the html code) http://localhost/test/image-test/css/images/background.png (by the index.js code from the extension) http://localhost/test/image-test/images/background.png => 404 html error
Relative URLs are allowed, and are relative to the URL of the stylesheet (not to the URL of the web page).
Same issue of course also for html requests which are located in sub directories e.g. /sub/test.html
.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:18 (8 by maintainers)
Top GitHub Comments
In Dark Reader settings you can choose theme generation mode other than Dynamic but every other isn’t cool. You can also write your custom theme mode with click on Static theme generation mode.
I just stumbled upon the same issue after seeing seemingly random 404 entries in my log file when using
background-image: url('../../images/image.png')
in my CSS files.