MCPcopy Index your code
hub / github.com/WebReflection/uce-loader / load

Function load

index.js:23–43  ·  view source on GitHub ↗
(mutations)

Source from the content-addressed store, hash-verified

21 var target = options.container || document;
22
23 var load = function load(mutations) {
24 for (var i = 0, length = mutations.length; i < length; i++) {
25 for (var addedNodes = mutations[i].addedNodes, j = 0, _length = addedNodes.length; j < _length; j++) {
26 var node = addedNodes[j];
27 var children = node.children,
28 getAttribute = node.getAttribute,
29 tagName = node.tagName;
30
31 if (getAttribute) {
32 var is = (getAttribute.call(node, 'is') || tagName).toLowerCase();
33
34 if (0 < is.indexOf('-') && !loaded.has(is) && !ignore.test(is)) {
35 loaded.add(is);
36 customElements.get(is) || options.on(is);
37 }
38
39 crawl(children);
40 }
41 }
42 }
43 };
44
45 var crawl = function crawl(addedNodes) {
46 load([{

Callers 1

crawlFunction · 0.70

Calls 1

crawlFunction · 0.70

Tested by

no test coverage detected