PageSourceSearch

https://www.napier.ac.uk/layouts/system/VisitorIdentification.js

js napier.ac.uk collected 2026-09-24 08:35:39 UTC 2,286 bytes, 71 lines download raw bytes

1function subscribeEvent(event, listener, useCapture) {
2  if (document.addEventListener) {
3    document.addEventListener(event, listener, useCapture);
4  } else if (document.attachEvent) {
5    document.attachEvent(event, listener, useCapture);
6  }
7}
8
9function unsubscribeEvent(event, listener, useCapture) {
10  if (document.removeEventListener) {
11    document.removeEventListener(event, listener, useCapture);
12  } else if (document.detachEvent) {
13    document.detachEvent(event, listener, useCapture);
14  }
15}
16
17function startActivityHandler(e) {
18    unsubscribeEvent("touchstart", arguments.callee, false);
19    document.documentElement.onmousemove = null; // We need it here to turn off mouse move too.
20
21   if (true) {
22        timeoutSleep(0, placeCssAspxRequest);
23    }
24};
25document.documentElement.onmousemove = startActivityHandler;
26subscribeEvent("touchstart", startActivityHandler, false);
27
28function placeCheckerRequest() {
29    var stt1 = '/layouts/system';
30    var stt2 = '/VIChecker.aspx?tstamp=';
31    var stt3 = getMetatagContent();
32
33    var fileref = document.createElement('link');
34    fileref.setAttribute('rel', 'stylesheet');
35    fileref.setAttribute('type', 'text/css');
36    fileref.setAttribute('href', stt1 + stt2 + stt3);
37    document.getElementsByTagName("head")[0].appendChild(fileref);
38}
39
40function placeCssAspxRequest() {
41    st1 = '/layouts/system/Visitor';
42    st2 = 'Identification';
43    st3 = 'CSS.aspx?' + new Date().getTime();
44
45    var fileref = document.createElement('link');
46    fileref.setAttribute('rel', 'stylesheet');
47    fileref.setAttribute('type', 'text/css');
48    fileref.setAttribute('href', st1 + st2 + st3);
49    document.getElementsByTagName("head")[0].appendChild(fileref);
50    
51    timeoutSleep(30000, placeCheckerRequest);
52}
53
54function timeoutSleep(milliseconds, callbackFunction) {
55    window.setTimeout(
56        function () {
57            callbackFunction();
58        }, milliseconds);
59}
60
61function getMetatagContent() {
62    var metas = document.getElementsByTagName('meta');
63
64    for (var i = 0; i < metas.length; i++) {
65        if (metas[i].getAttribute("name") == "VIcurrentDateTime") {
66            return metas[i].getAttribute("content");
67        }
68    }
69
70    return "";
71}

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.