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.2.1 to 0.2.2

14

dist/browser-sync-connect.js

@@ -10,3 +10,4 @@ (function(exports) {

port = port || 3e3;
version = version || "0.8.2";
version = version || "0.9.1";
var hasConnector = parseFloat(version) >= .9;
var socketUrl = "//" + host + ":" + port;

@@ -16,9 +17,14 @@ var clientUrl = "//" + host + ":" + (port + 1);

script.src = socketUrl + "/socket.io/socket.io.js";
script.defer = hasConnector;
script.id = id;
script.onload = function() {
var s = document.createElement("script");
s.innerHTML = 'var ___socket___ = io.connect("' + socketUrl + '");';
document.body.appendChild(s);
var s;
if (!hasConnector) {
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";
s.defer = hasConnector;
document.body.appendChild(s);

@@ -25,0 +31,0 @@ };

@@ -1,1 +0,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);
!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.9.1";var hasConnector=parseFloat(version)>=.9,socketUrl="//"+host+":"+port,clientUrl="//"+host+":"+(port+1),script=document.createElement("script");script.src=socketUrl+"/socket.io/socket.io.js",script.defer=hasConnector,script.id=id,script.onload=function(){var s;hasConnector||(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",s.defer=hasConnector,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.2.1",
"version": "0.2.2",
"description": "connect to browser sync without copying the script snippets to the html source",

@@ -5,0 +5,0 @@ "main": "src/browser-sync-connect.js",

@@ -17,2 +17,4 @@ (function(exports) {

var hasConnector = parseFloat(version) >= 0.9;
var socketUrl = '//' + host + ':' + port;

@@ -23,2 +25,3 @@ var clientUrl = '//' + host + ':' + (port + 1);

script.src = socketUrl + '/socket.io/socket.io.js';
script.defer = hasConnector;
script.id = id;

@@ -28,10 +31,13 @@

var s = document.createElement('script');
var s;
s.innerHTML = 'var ___socket___ = io.connect("' + socketUrl + '");';
document.body.appendChild(s);
if (!hasConnector) {
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';
s.defer = hasConnector;
document.body.appendChild(s);

@@ -38,0 +44,0 @@ };

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