download.driversupport.com Open in urlscan Pro
13.84.181.47  Public Scan

Submitted URL: https://d3ti88jhu7fk5j.cloudfront.net/scripts/unbounce/matchMedia.js?v=1.0.0.56
Effective URL: https://download.driversupport.com/scripts/unbounce/matchMedia.js?v=1.0.0.56
Submission: On January 06 via api from LU — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */

window.matchMedia = window.matchMedia || (function (doc, undefined) {

    var bool,
        docElem = doc.documentElement,
        refNode = docElem.firstElementChild || docElem.firstChild,
        // fakeBody required for <FF4 when executed in <head>
        fakeBody = doc.createElement('body'),
        div = doc.createElement('div');

    div.id = 'mq-test-1';
    div.style.cssText = "position:absolute;top:-100em";
    fakeBody.style.background = "none";
    fakeBody.appendChild(div);

    return function (q) {

        div.innerHTML = '&shy;<style media="' + q + '"> #mq-test-1 { width: 42px; }</style>';

        docElem.insertBefore(fakeBody, refNode);
        bool = div.offsetWidth === 42;
        docElem.removeChild(fakeBody);

        return { matches: bool, media: q };
    };

}(document));