4 exports.Options = Options = (function() {
13 this.maxdelay = 60000;
14 this.handshake_timeout = 5000;
17 Options.prototype.set = function(name, value) {
18 if (typeof value === 'undefined') {
24 return this[name] = value;
31 Options.extract = function(document) {
32 var element, keyAndValue, m, mm, options, pair, src, _i, _j, _len, _len1, _ref, _ref1;
33 _ref = document.getElementsByTagName('script');
34 for (_i = 0, _len = _ref.length; _i < _len; _i++) {
36 if ((src = element.src) && (m = src.match(/^[^:]+:\/\/(.*)\/z?livereload\.js(?:\?(.*))?$/))) {
37 options = new Options();
38 options.https = src.indexOf("https") === 0;
39 if (mm = m[1].match(/^([^\/:]+)(?::(\d+))?$/)) {
42 options.port = parseInt(mm[2], 10);
46 _ref1 = m[2].split('&');
47 for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
49 if ((keyAndValue = pair.split('=')).length > 1) {
50 options.set(keyAndValue[0].replace(/-/g, '_'), keyAndValue.slice(1).join('='));