Search code examples
javascriptajaxsafarigoogle-closure-library

Closure Library: good.net.XhrIo.send not working on Safari


goog.net.XhrIo.send in Closure Library outputs "undefined" error in Safari v8.0.5, whereas it works fine on Chrome and FireFox.

What can I do to solve this error?
What are the possible causes?

Static Access

goog.net.XhrIo.send('filename.json', function(e) {
    console.log(e.target.getResponseJson());
});

Instance Access

var request = new goog.net.XhrIo();
var url = 'rest/search/test';
goog.events.listen(request, 'complete', function() {
    // etc
});
request.send(url,'GET');

console.log(goog.net.XhrIo.send)

  • Safari: undefined
  • Chrome: function (url, opt_callback, ...)
  • FireFox: function (url, opt_callback, ...)

I've already tried

  • clearing cache on Safari
  • static access and instance access (both failed)
  • using send() method on multiple pages (all failed)
  • updating dependencies

Solution

  • I've found the error was caused by "AdBlock" (Browser Extension).
    After I turned it off, good.net.XhrIo.send worked on Safari.