Created
May 12, 2013 01:56
-
-
Save dinhvh/5562112 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var findCIDImageURLInNode = function(node, links) { | |
var child = node.firstChild; | |
while (child != null) { | |
var next; | |
next = child.nextSibling; | |
if (child.nodeType == Node.ELEMENT_NODE) { | |
var tagName; | |
tagName = child.tagName.toLowerCase() | |
if (tagName == 'img') { | |
var url = child.src; | |
if (url != null) { | |
if (url.indexOf('cid:') == 0) { | |
links.push(url); | |
} | |
if (url.indexOf('x-mailcore-image:') == 0) { | |
links.push(url); | |
} | |
} | |
} | |
} | |
findCIDImageURLInNode(child, links); | |
child = next; | |
} | |
} | |
var findCIDImageURL = function() { | |
var imgLinks = new Array(); | |
findCIDImageURLInNode(document.body, imgLinks); | |
return JSON.stringify(imgLinks); | |
} | |
var loaded = function() { | |
//findCIDImageURL(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment