Setting src on image should kick off request
See original GitHub issueIf I load the following with jsdom, I expect that a request for the image should be kicked off when
<html>
<head>
</head>
<body>
<script src="http://code.jquery.com/jquery-1.5.min.js"></script>
<script language="javascript">
i = new Image();
i.src = 'http://localhost/favicon.ico';
console.log(i);
</script>
</body>
</html>
I am attempting this with following features:
{features:
{
FetchExternalResources: [ 'script', 'img' ],
ProcessExternalResources: [ 'script', 'img' ],
MutationEvents: '2.0',
QuerySelector: false } }
I am not sure if this is the correct behavior or not, but I would expect this work like it works in a browser.
Issue Analytics
- State:
- Created 12 years ago
- Comments:30 (19 by maintainers)
Top Results From Across the Web
javascript - Set img src without issuing a request
Any new Image tag with src will result in a request going out from the browser, even if it's just in memory, or...
Read more >Preloading responsive images - web.dev
This kicks off a request using the same resource selection logic that srcset and sizes will apply. Use cases #. Preloading dynamically-injected ...
Read more >How to Use HTML5 “picture”, “srcset”, and “sizes” for ...
Start with a Default <img> Element; How to Use “srcset” for a Set of Images; Using “sizes” to Control Image Layout
Read more >A 4-Minute Guide to the Img src Attribute in HTML
Learn how to use and troubleshoot any issues with the img src attribute in HTML.
Read more >How To Set Up a React Project with Create React App
This command will kick off a build process that will download the base ... The src/ directory contains the React JavaScript code for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
What’s with this? It is really bad that
new Image()
doesn’t work. I use it for decoding to createnew Image()
and then load image with data URI as src.NVM. I nested FetchExternalResources inside features and now it works fine. BTW I am really excited for the new API. Thanks!