done-autorender
Version:
Autorender CanJS projects
36 lines (33 loc) • 777 B
HTML
<html>
<head></head>
<body>
<script>
(function(){
var xhrOpen = XMLHttpRequest.prototype.open;
var xhrUrl;
XMLHttpRequest.prototype.open = function(method, url){
xhrUrl = url;
if(url === "foo://bar") return;
return xhrOpen.apply(this, arguments);
};
var xhrSend = XMLHttpRequest.prototype.send;
XMLHttpRequest.prototype.send = function(){
if(xhrUrl === "foo://bar") return;
return xhrSend.apply(this, arguments);
};
window.XHR_CACHE = [
{ request: { url: "foo://bar" },
response: { responseText: JSON.stringify([
"one",
"two",
"three"
]),
status: 404,
headers: "application/json" } }
];
})();
</script>
<script src="../../node_modules/steal/steal.js"
data-main="test/async/index.stache!done-autorender"></script>
</body>
</html>