javascript - getComputedStyle() and properties that can have a url associated with them -
i'm trying make snippet of javascript can list of images (or other resources) used in web page because referenced in css. typically background images, because somewhere in css there this:
.something { background: transparent url(images/somethingbg.png) no-repeat top left; }
it seems can of these array (with full path) following snippet:
var outputarray = []; var string = ""; var elems = document.getelementsbytagname('*'); (var = 0; i<elems.length; i++) { var elem = elems[i]; var style = window.getcomputedstyle(elem, null); var value = style.getpropertyvalue("background-image"); if (value && value != "" && value != "none") outputarray.push(value); }
however, want work on file out there (running bookmarklet), , know url() can apply things aren't background images, instance "list-style-image". there more? there list of these somewhere?
afaik here's pretty exhaustive (?) list:
- background-image (shorthand background) beware of multiple
url("")
in css3 - list-style-image (shorthand list-style)
- behavior (-ms-behavior), filter (-ms-filter), filter , -moz-binding
- cursor
- content
- attribute selectors contain uri values: href, cite, xmlns, src, data-*, data, codebase, classid, archive, longdesc, profile…
- @import, @namespace , @font-face
Comments
Post a Comment