diff --git a/src/HTMLImports.js b/src/HTMLImports.js
index 868193c..eba1478 100644
--- a/src/HTMLImports.js
+++ b/src/HTMLImports.js
@@ -56,7 +56,7 @@ if (!useNative) {
return doc === mainDoc ? this.documentPreloadSelectors :
this.importsPreloadSelectors;
},
- loaded: function(url, elt, resource, err) {
+ loaded: function(url, elt, resource, err, redirectedUrl) {
flags.load && console.log('loaded', url, elt);
// store generic resource
// TODO(sorvell): fails for nodes inside .content
@@ -68,7 +68,7 @@ if (!useNative) {
// if we've never seen a document at this url
if (doc === undefined) {
// generate an HTMLDocument from data
- doc = err ? null : makeDocument(resource, url);
+ doc = err ? null : makeDocument(resource, redirectedUrl || url);
if (doc) {
doc.__importLink = elt;
// note, we cannot use MO to detect parsed nodes because
diff --git a/src/Loader.js b/src/Loader.js
index ca5c480..cc36bb1 100644
--- a/src/Loader.js
+++ b/src/Loader.js
@@ -114,22 +114,13 @@
receive: function(url, elt, err, resource, redirectedUrl) {
this.cache[url] = resource;
var $p = this.pending[url];
- if ( redirectedUrl && redirectedUrl !== url ) {
- this.cache[redirectedUrl] = resource;
- $p = $p.concat(this.pending[redirectedUrl]);
- }
for (var i=0, l=$p.length, p; (i
+ load = true;
+
\ No newline at end of file
diff --git a/test/html/redirect/imports/redirect/googley.png b/test/html/redirect/imports/redirect/googley.png
new file mode 100644
index 0000000..1974f31
Binary files /dev/null and b/test/html/redirect/imports/redirect/googley.png differ
diff --git a/test/html/redirect/imports/redirect/load.html b/test/html/redirect/imports/redirect/load.html
new file mode 100644
index 0000000..c217c6e
--- /dev/null
+++ b/test/html/redirect/imports/redirect/load.html
@@ -0,0 +1,10 @@
+
+
diff --git a/test/html/redirect/load-redirect.html b/test/html/redirect/load-redirect.html
new file mode 100644
index 0000000..53faa3f
--- /dev/null
+++ b/test/html/redirect/load-redirect.html
@@ -0,0 +1,27 @@
+
+
+
+ load redirect Test
+
+
+
+
+
+
+
+
+
+