crimx / blog-comments

utterances🔮 comments on https://blog.crimx.com.
0 stars 0 forks source link

/2017/03/09/get-all-images-in-dom-including-background-en/ #10

Open utterances-bot opened 4 years ago

utterances-bot commented 4 years ago

Get All Images in DOM (including background) | CRIMX BLOG

Quite useful if you are writing an browser extension or something. To get all the images in DOM there are actually three places we are going to look at: element, background-image CSS…

https://blog.crimx.com/2017/03/09/get-all-images-in-dom-including-background-en/

TheSecurityDev commented 4 years ago

This looks like exactly what I've been searching for, for my own Chrome Extension 😅. I created an account just to say thank you 😄.

StigNygaard commented 4 years ago

Thanks a lot. This was great help for a core feature in my exif viewer browser extension. https://github.com/StigNygaard/xIFr You'll find a few modifications in my code. It is some months ago I did the coding, but as far as I remember this includes handling multiple background images in an element, including the start-element itself in search, and excluding invisible elements from search.

ColtonB99 commented 3 years ago

This is the cleanest code I've ever seen in my life, you're an inspiration thank you for teaching me so many new things!

wangz-code commented 2 years ago

我也在写一个 chrome 插件 会用到图片正在没有头绪, 非常感谢!