PageSourceSearch

https://www.roots.gov.sg/scripts/campaign-monitor.min.js

js roots.gov.sg collected 2026-09-24 19:41:04 UTC 3,273 bytes, 78 lines download raw bytes

1
2function cmGetIframeHeight(iframe) {
3    iframe.contentWindow.postMessage("getFrameHeight", "https://confirmsubscription.com");
4}
5function cmOnMessage(event) {
6    if (event.origin !== "https://confirmsubscription.com")
7        return;
8        
9    if (event.data.hasOwnProperty("frameHeight")) {
10        document.getElementById("cm-popup-iframe").height = event.data.frameHeight;
11    }
12}
13function cmAddModalContent() {
14    let style = document.createElement('style');
15    style.innerHTML = `
16        #cm-popup-overlay {
17            opacity: 0;
18            animation-name: fadein;
19            animation-duration: 1s;
20            animation-delay: .5s;
21            animation-fill-mode: forwards;
22        }
23        #p-container {
24            position: relative;
25            width: 545px;
26            margin: 100px auto;
27        }
28        #cm-popup-iframe {
29            width: 100%;
30            border-radius: 4px;
31        }
32        @media only screen and (max-width: 760px) {
33            #p-container { width: 100%; margin: 0; }
34            #cm-popup-iframe { width: 100%; border-radius: 0px;}
35        }
36        @keyframes fadein {
37            from { opacity: 0; }
38            to { opacity: 1; }
39        }
40    `;
41    document.head.appendChild(style);
42
43    let o = document.createElement("div");
44    o.innerHTML = `
45    <div id="cm-popup-overlay" style="position:fixed; background:rgba(48, 69, 92, 0.5000); z-index:99999; height:100%; width:100%; top:0; left:0; overflow-y:auto;">
46        <div id="p-container">
47            <div id="cmsgpf-close-btn"
48                style="height:16px;width:16px;display:inline-block;position:absolute;cursor:pointer;top:0;right:0;margin-top:10px;margin-right:10px;">
49                <svg viewBox="0 0 512 512" fill="#434d5d">
50                    <path
51                        d="M437.5 386.6L306.9 256l130.6-130.6c14.1-14.1 14.1-36.8 0-50.9-14.1-14.1-36.8-14.1-50.9 0L256 205.1 125.4 74.5c-14.1-14.1-36.8-14.1-50.9 0-14.1 14.1-14.1 36.8 0 50.9L205.1 256 74.5 386.6c-14.1 14.1-14.1 36.8 0 50.9 14.1 14.1 36.8 14.1 50.9 0L256 306.9l130.6 130.6c14.1 14.1 36.8 14.1 50.9 0 14-14.1 14-36.9 0-50.9z"
52                        fillRule="evenodd" />
53                </svg>
54            </div>
55            <iframe id="cm-popup-iframe" onload="cmGetIframeHeight(this)"
56                src="https://confirmsubscription.com/h/d/081B4CD661CEB460/forms/2BFF282C9EB6CF54" width="545" height="935"
57                frameborder="0" marginwidth="0" margin="0" height="0" scrolling="no" allowfullscreen></iframe>
58        </div>
59    </div>`;
60    document.getElementsByTagName("body")[0].appendChild(o);
61    let c = document.getElementById("cmsgpf-close-btn");
62    c.onclick = function () {
63        document.getElementById("cm-popup-overlay").style.display = "none"
64        window.localStorage.setItem("cmsgpf-last-closed", new Date());
65    };
66}
67document.addEventListener("DOMContentLoaded", function () {
68    let t = 0;
69    window.addEventListener('message', cmOnMessage);
70    setTimeout(() => {
71        let e = window.localStorage.getItem("cmsgpf-last-closed");
72        let expire = new Date(e);
73        expire.setSeconds(expire.getSeconds() + 31536000);
74        if (isNaN(expire) || new Date() > expire) {
75            cmAddModalContent();
76        }
77    }, t);
78});

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.