(function () {
    "use strict";
    var delay, jitter, blacklist;

    safari.application.addEventListener('message', function (event) {
        if (event.name === 'getSettings') {
            delay = safari.extension.settings.delay;
            jitter = safari.extension.settings.jitter;
            blacklist = safari.extension.settings.blacklist;

            if (jitter) {
                delay -= jitter;
                delay += 2 * jitter * Math.random();
            }
            delay *= 1000;

            blacklist = blacklist.split(/\s+/).filter(function (hostname) {
                return hostname.toLowerCase();
            });

            event.target.page.dispatchMessage('settings', {
                'delay': delay,
                'blacklist': blacklist,
            });
        }
    }, false);
}());

(function () {
    "use strict";
    var delay, jitter, blacklist;

    safari.application.addEventListener('message', function (event) {
        if (event.name === 'getSettings') {
            delay = safari.extension.settings.delay;
            jitter = safari.extension.settings.jitter;
            blacklist = safari.extension.settings.blacklist;

            if (jitter) {
                delay -= jitter;
                delay += 2 * jitter * Math.random();
            }
            delay *= 1000;

            blacklist = blacklist.split(/\s+/).filter(function (hostname) {
                return hostname.toLowerCase();
            });

            event.target.page.dispatchMessage('settings', {
                'delay': delay,
                'blacklist': blacklist
            });
        }
    }, false);
}());

Remove trailing comma to appease JSHint.
Remove trailing comma to appease JSHint.
