Permalink
Browse files

Temporary fix for #27 (exception in ajax() while in window.onerror ca…

…uses bad behavior of Firefox). However, the cause of ajax() exception is not clear.
  • Loading branch information...
1 parent d17d9ae commit 59f60d26801c82ec0ece36c0b6c9694cfbb08b05 @victor-homyakov victor-homyakov committed Nov 4, 2011
Showing with 10 additions and 6 deletions.
  1. +10 −6 stacktrace.js
View
16 stacktrace.js
@@ -207,16 +207,20 @@ printStackTrace.implementation.prototype = {
sourceCache: {},
/**
- * @return the text from a given URL.
+ * @return the text from a given URL
*/
ajax: function(url) {
var req = this.createXMLHTTPObject();
- if (!req) {
- return;
+ if (req) {
+ try {
+ // FIXME why Firefox 3.6-7.0 raises error for file:///
+ req.open('GET', url, false);
+ req.send('');
+ return req.responseText;
+ } catch (e) {
+ }
}
- req.open('GET', url, false);
- req.send('');
- return req.responseText;
+ return '';
},
/**

0 comments on commit 59f60d2

Please sign in to comment.