MCPcopy Create free account
hub / github.com/tensorflow/tfjs-examples / getImageElementsWithSrcUrl

Function getImageElementsWithSrcUrl

chrome-extension/src/content.js:66–70  ·  view source on GitHub ↗

* Returns a list of all DOM image elements pointing to the provided srcUrl. * @param {string} srcUrl which url to search for, including 'http(s)://' * prefix. * @returns {HTMLElement[]} all img elements pointing to the provided srcUrl

(srcUrl)

Source from the content-addressed store, hash-verified

64 * @returns {HTMLElement[]} all img elements pointing to the provided srcUrl
65 */
66function getImageElementsWithSrcUrl(srcUrl) {
67 const imgElArr = Array.from(document.getElementsByTagName('img'));
68 const filtImgElArr = imgElArr.filter(x => x.src === srcUrl);
69 return filtImgElArr;
70}
71
72/**
73 * Finds and removes all of the text predictions added by this extension, and

Callers 1

content.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected