Permalink
Browse files

Don't even attempt XHR on file:

  • Loading branch information...
1 parent 95d7258 commit 1a02e7edd168ca3687fccff96f7d7dde5618417a @judofyr committed Mar 12, 2013
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/mockle/source.js
View
@@ -24,11 +24,13 @@ Mockle.module('Source', ['mockie'], {
fetch: function(src, cb) {
var me = this;
- var req = window.ActiveXObject
- ? new ActiveXObject('Microsoft.XMLHTTP')
- : new XMLHttpRequest();
try {
+ if (location.protocol == "file:") throw "nope";
+
+ var req = window.ActiveXObject
+ ? new ActiveXObject('Microsoft.XMLHTTP')
+ : new XMLHttpRequest();
req.open("GET", src, true);
req.send();
req.onreadystatechange = function() {

0 comments on commit 1a02e7e

Please sign in to comment.