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:

  1. background-image (shorthand background) beware of multiple url("") in css3
  2. list-style-image (shorthand list-style)
  3. behavior (-ms-behavior), filter (-ms-filter), filter , -moz-binding
  4. cursor
  5. content
  6. attribute selectors contain uri values: href, cite, xmlns, src, data-*, data, codebase, classid, archive, longdesc, profile…
  7. @import, @namespace , @font-face

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -