Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

browser-sync-connect

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browser-sync-connect - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

67

dist/browser-sync-connect.js

@@ -1,40 +0,29 @@

!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.out=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
var browserSyncConnect = function(host, version, port) {
'use strict';
var id = '__bs_script__';
if (document.getElementById(id)) {
return;
}
host = host || window.location.hostname;
port = port || 3000;
version = version || '0.8.2';
var socketUrl = '//' + host + ':' + port;
var clientUrl = '//' + host + ':' + (port + 1);
var script = document.createElement('script');
script.src = socketUrl + '/socket.io/socket.io.js';
script.id = id;
script.onload = function() {
var s = document.createElement('script');
s.innerHTML = 'var ___socket___ = io.connect("' + socketUrl + '");';
document.body.appendChild(s);
s = document.createElement('script');
s.src = clientUrl + '/client/browser-sync-client.' + version + '.js';
document.body.appendChild(s);
(function(exports) {
"use strict";
var browserSyncConnect = function(host, version, port) {
var id = "__bs_script__";
if (document.getElementById(id)) {
return;
}
host = host || window.location.hostname;
port = port || 3e3;
version = version || "0.8.2";
var socketUrl = "//" + host + ":" + port;
var clientUrl = "//" + host + ":" + (port + 1);
var script = document.createElement("script");
script.src = socketUrl + "/socket.io/socket.io.js";
script.id = id;
script.onload = function() {
var s = document.createElement("script");
s.innerHTML = 'var ___socket___ = io.connect("' + socketUrl + '");';
document.body.appendChild(s);
s = document.createElement("script");
s.src = clientUrl + "/client/browser-sync-client." + version + ".js";
document.body.appendChild(s);
};
document.body.appendChild(script);
};
document.body.appendChild(script);
};
},{}]},{},[1])
(1)
});
typeof module !== "undefined" && module.exports ? module.exports = browserSyncConnect : typeof define === "function" && define.amd ? define([], function() {
return browserSyncConnect;
}) : exports.browserSyncConnect = browserSyncConnect;
})(this);

@@ -1,1 +0,1 @@

!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.out=e()}}(function(){return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(){},{}]},{},[1])(1)});
!function(exports){"use strict";var browserSyncConnect=function(host,version,port){var id="__bs_script__";if(!document.getElementById(id)){host=host||window.location.hostname,port=port||3e3,version=version||"0.8.2";var socketUrl="//"+host+":"+port,clientUrl="//"+host+":"+(port+1),script=document.createElement("script");script.src=socketUrl+"/socket.io/socket.io.js",script.id=id,script.onload=function(){var s=document.createElement("script");s.innerHTML='var ___socket___ = io.connect("'+socketUrl+'");',document.body.appendChild(s),s=document.createElement("script"),s.src=clientUrl+"/client/browser-sync-client."+version+".js",document.body.appendChild(s)},document.body.appendChild(script)}};"undefined"!=typeof module&&module.exports?module.exports=browserSyncConnect:"function"==typeof define&&define.amd?define([],function(){return browserSyncConnect}):exports.browserSyncConnect=browserSyncConnect}(this);
{
"name": "browser-sync-connect",
"version": "0.1.0",
"description": "connect to browser sync without copying the script snippets to the html source",
"main": "src/browser-sync-connect.js",
"scripts": {
"build-debug": "browserify src/browser-sync-connect.js --s out > dist/browser-sync-connect.js",
"build-min": "browserify src/browser-sync-connect.js --s out | uglifyjs -c > dist/browser-sync-connect.min.js",
"build": "npm run build-debug && npm run build-min",
"watch": "watchify src/browser-sync-connect.js -d --s out -o dist/browser-sync-connect.js -v",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/soenkekluth/browser-sync-connect.git"
},
"keywords": [
"browser-sync",
"browsersync",
"connect",
"script"
],
"author": "Sönke Kluth <soenke.kluth@gmail.com> (http://soenkekluth.com/)",
"license": "MIT",
"bugs": {
"url": "https://github.com/soenkekluth/browser-sync-connect/issues"
},
"homepage": "https://github.com/soenkekluth/browser-sync-connect",
"devDependencies": {
"uglify-js": "^2.4.13",
"browserify": "^3.46.0",
"watchify": "^0.8.3"
}
"name": "browser-sync-connect",
"version": "0.2.0",
"description": "connect to browser sync without copying the script snippets to the html source",
"main": "src/browser-sync-connect.js",
"scripts": {
"build-debug": "uglifyjs src/browser-sync-connect.js -b -o dist/browser-sync-connect.js",
"build-min": "uglifyjs src/browser-sync-connect.js -c -o dist/browser-sync-connect.min.js",
"build": "npm run build-debug && npm run build-min",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/soenkekluth/browser-sync-connect.git"
},
"keywords": [
"browser-sync",
"browsersync",
"connect",
"script"
],
"author": "Sönke Kluth <soenke.kluth@gmail.com> (http://soenkekluth.com/)",
"license": "MIT",
"bugs": {
"url": "https://github.com/soenkekluth/browser-sync-connect/issues"
},
"homepage": "https://github.com/soenkekluth/browser-sync-connect",
"devDependencies": {
"uglify-js": "latest"
}
}

@@ -1,35 +0,45 @@

var browserSyncConnect = function(host, version, port) {
(function(exports) {
'use strict';
var id = '__bs_script__';
if (document.getElementById(id)) {
return;
}
var browserSyncConnect = function(host, version, port) {
host = host || window.location.hostname;
port = port || 3000;
version = version || '0.8.2';
var id = '__bs_script__';
var socketUrl = '//' + host + ':' + port;
var clientUrl = '//' + host + ':' + (port + 1);
if (document.getElementById(id)) {
return;
}
var script = document.createElement('script');
script.src = socketUrl + '/socket.io/socket.io.js';
script.id = id;
host = host || window.location.hostname;
port = port || 3000;
version = version || '0.8.2';
script.onload = function() {
var socketUrl = '//' + host + ':' + port;
var clientUrl = '//' + host + ':' + (port + 1);
var s = document.createElement('script');
var script = document.createElement('script');
script.src = socketUrl + '/socket.io/socket.io.js';
script.id = id;
s.innerHTML = 'var ___socket___ = io.connect("' + socketUrl + '");';
document.body.appendChild(s);
script.onload = function() {
var s = document.createElement('script');
s = document.createElement('script');
s.src = clientUrl + '/client/browser-sync-client.' + version + '.js';
document.body.appendChild(s);
s.innerHTML = 'var ___socket___ = io.connect("' + socketUrl + '");';
document.body.appendChild(s);
s = document.createElement('script');
s.src = clientUrl + '/client/browser-sync-client.' + version + '.js';
document.body.appendChild(s);
};
document.body.appendChild(script);
};
document.body.appendChild(script);
};
(typeof module !== 'undefined' && module.exports) ? (module.exports = browserSyncConnect) : (typeof define === 'function' && define.amd ? (define([], function() {
return browserSyncConnect;
})) : (exports.browserSyncConnect = browserSyncConnect));
}(this));
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc