Permalink
Browse files

Fix all file loading (document and resources) to use same code path.

  • Loading branch information...
1 parent a4ca575 commit b6e1177f43da6bdba8061d65e12ce9cd799a3510 @assaf committed May 28, 2012
Showing with 3 additions and 9 deletions.
  1. +3 −9 lib/zombie/jsdom_patches.coffee
@@ -95,15 +95,9 @@ HTML.resourceLoader.load = (element, href, callback)->
window.browser.resources.get url, @enqueue(element, loaded, url.pathname)
else
url = URL.parse(@resolve(document, href))
- if url.protocol == "file:"
- loaded = (data, filename)->
- callback.call this, data, filename
- file = "/#{url.hostname}#{url.pathname}"
- @readFile file, @enqueue(element, loaded, file)
- else
- loaded = (response, filename)->
- callback.call this, response.body, URL.parse(response.url).pathname
- window.browser.resources.get url, @enqueue(element, loaded, url.pathname)
+ loaded = (response, filename)->
+ callback.call this, response.body, URL.parse(response.url).pathname
+ window.browser.resources.get url, @enqueue(element, loaded, url.pathname)
# Support for iframes that load content when you set the src attribute.

0 comments on commit b6e1177

Please sign in to comment.