WebSocket connection to 'ws://localhost:35729/livereload' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED chromereload.js:9
'WebSocket.URL' is deprecated. Please use 'WebSocket.url' instead. chromereload.js:12
I'm getting this error message in my chrome extension since chrome updated to version 38. I'm not quite sure whats going on here, but now opening most things causes the extension to crash. I used yeoman to scaffold my project at the beginning, and everything was working fine. I tried removing livereload from the manifest, but that seems to break everything. Any help would be appreciated.
Here is the code:
'use strict';
// Reload client for Chrome Apps & Extensions.
// The reload client has a compatibility with livereload.
// WARNING: only supports reload command.
var LIVERELOAD_HOST = 'localhost:';
var LIVERELOAD_PORT = 35729;
var connection = new WebSocket('ws://' + LIVERELOAD_HOST + LIVERELOAD_PORT + '/livereload');
connection.onerror = function (error) {
console.log('reload connection got error' + JSON.stringify(error));
};
connection.onmessage = function (e) {
if (e.data) {
var data = JSON.parse(e.data);
if (data && data.command === 'reload') {
chrome.runtime.reload();
}
}
};
In Chrome this message is emitted when using something like JSON.stringify() or similar on a WebSocket object. These kind of routines will access the WebSocket.URL property, which is deprecated, and emit this warning. Even if your code doesn't explicitly call WebSocket.URL. You can delete this property to mute the warning from Chrome.
var ws = new WebSocket('wss://example.com/');
delete ws.URL;
console.log(JSON.stringify(ws));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With