dymo-connect-framework icon indicating copy to clipboard operation
dymo-connect-framework copied to clipboard

Synchronous XMLHttpRequest on the main thread is deprecated

Open 4deeptech opened this issue 4 years ago • 1 comments

Can you fix this issue? This was brought over from the older library.

The issue is in ajaxSync using archaic methods to fetch remote data. This causes the browser to hang/freeze during this process.

4deeptech avatar Dec 15 '20 23:12 4deeptech

When using the dymo.label.framework.init() the page would hang for +- 6 seconds when the local service is not installed. I wrote something dirty to check if the service is running.

function initiateDymo(host) { for(var i = 41951; i <= 41960; i++) { (function(i) { setTimeout(function(port) { $.ajax({ url : 'https://' + host + ':' + port + '/DYMO/DLS/Printing/StatusConnected', timeout: 300, dataType : 'json', success : function(data, textStatus) { // your code }, error : function(e,a) { // your code } }); }, 1, i) })(i) } }

Petaht avatar Dec 24 '20 13:12 Petaht