Check if CSS pseudoElement after/before exist on an element using JS
<p>edit: Actually... none of that works properly!</p>

<p>For a non-existent pseudo-element, it returns the actual element's style, so to check a pseudo-element's background-image for existence, you need to do: </p>

<p><code>(window.getComputedStyle(emElem,'after').backgroundImage!=window.getComputedStyle(emElem).backgroundImage)&amp;&amp;window.getComputedStyle(emElem,'after').backgroundImage</code></p>

<p>I'm pretty sure that shouldn't be necessary.</p>

<hr>

<pre><code>window.getComputedStyle(element,'after').content!='none';
</code></pre>

<p>That seems to work, but it is slow, and needs to be executed many times on some pages(I've seen upwards of 4 seconds delay using this.) Is there not a more sane way of getting this information?</p>
