diff --git a/Readme.md b/Readme.md index 8317178..aac2013 100644 --- a/Readme.md +++ b/Readme.md @@ -51,7 +51,7 @@ postpone.setThreshold( "200px" ).postpone() // Change the threshold to 200px. *Note:* it is good practice to chain the `postpone()` method after changing the threshold to make sure postpone reexamines the postponed elements in the document and check if any of them should be loaded. - The postpone polyfill works with audio, embed, iframe, img, image, picture, use, video, and tref elements. *Note:* although the specification for `picture` is still evolving, postpone has basic support for it and is fully compatible with the [pictureTime polyfill](https://github.com/chuckcarpenter/picturetime). + The postpone polyfill works with audio, embed, iframe, img, image, object, picture, use, video, and tref elements. *Note:* although the specification for `picture` is still evolving, postpone has basic support for it and is fully compatible with the [pictureTime polyfill](https://github.com/chuckcarpenter/picturetime). Postpone works by modyfing the `src` and `xlink:href` attributes of elements and their descendant `source` elements when they become visible. diff --git a/bower.json b/bower.json index f58d5fd..9dfb7db 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "postpone", "main": "index.js", - "version": "0.5.0", + "version": "0.6.0", "homepage": "https://github.com/lsvx/postpone", "authors": [ "Lucas Serven " diff --git a/component.json b/component.json index 984d8e4..36d4662 100644 --- a/component.json +++ b/component.json @@ -2,7 +2,7 @@ "name": "postpone", "repo": "lsvx/postpone", "description": "A polyfill for postponing the loading of media.", - "version": "0.5.0", + "version": "0.6.0", "keywords": ["postpone", "media", "resource", "priority", "download"], "dependencies": {}, "development": {}, diff --git a/package.json b/package.json index ad1f60d..c2b67cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "postpone", - "version": "0.5.0", + "version": "0.6.0", "description": "A polyfill for postponing the loading of media.", "main": "index.js", "directories": { diff --git a/test/build.js b/test/build.js index 8ac0385..f7ebe6a 100644 --- a/test/build.js +++ b/test/build.js @@ -231,7 +231,7 @@ require.register("postpone/index.js", Function("exports, require, module", * @property {string} tags - A list of all the tags for which postpone\n\ * will work;\n\ */\n\ - this.tags = \"audio, embed, iframe, img, image, picture, use, video, tref\";\n\ + this.tags = \"audio, embed, iframe, img, image, object, picture, use, video, tref\";\n\ /**\n\ * @property {array} elements - An array of all the postponed elements in the document.\n\ */\n\ @@ -639,6 +639,17 @@ require.register("postpone/index.js", Function("exports, require, module", }\n\ }\n\ }\n\ +\n\ + else if ( el.tagName.toLowerCase() === \"object\" && el.getAttribute( \"data-data\" )) {\n\ + el.setAttribute( \"data\", el.getAttribute( \"data-data\" ));\n\ +\n\ + /**\n\ + * This is necessary to make Safari (and, apparently, old versions of Chrome)\n\ + * re-render the new content; see:\n\ + * stackoverflow.com/questions/11245385/object-works-in-every-browser-except-google-chrome\n\ + */\n\ + el.innerHTML = el.innerHTML;\n\ + }\n\ \n\ return el;\n\ };\n\