PageSourceSearch

http://www.rosenau.at/s/SCRIPTS/domhelpers.js

js rosenau.at collected 2026-10-02 19:16:25 UTC 1,372 bytes, 49 lines download raw bytes

1try
2{
3    window.doc=window.document;
4    
5    window.D={
6        delegate: function(n,etype,fun,sel)
7        {
8            var f;
9            n.addEventListener(etype,f=function(ev)
10            {
11                var n=ev.target.closest(sel);
12                ev.delegationTarget=n;
13                if (n && ev.currentTarget.contains(n))
14                    fun.call(n,ev)
15            })
16            return {
17                cancel:function(etype,f)
18                {
19                    this.removeEventListener(etype,f)
20                }.bind(n,etype,f)
21            }
22        },
23        loaded: new Promise(function(resolve,reject)
24        {
25            if (document.readyState!=='loading')
26                resolve(true);
27            else
28            {
29                document.addEventListener('DOMContentLoaded',function(ev)
30                {
31                    resolve(true);
32                })
33            }
34        })
35    }
36    Document.prototype.one=Document.prototype.querySelector;
37    Document.prototype.all=Document.prototype.querySelectorAll;
38    
39    Element.prototype.one=Element.prototype.querySelector;
40    Element.prototype.all=Element.prototype.querySelectorAll;
41    
42    Node.prototype.on=Node.prototype.addEventListener;
43    Node.prototype.delegate=function(etype,fun,sel)
44    {
45        return D.delegate(this,etype,fun,sel);
46    }
47}
48catch (ex)
49{ }

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.