<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>create screenshot using jquery &#8211; Sibeesh Passion</title>
	<atom:link href="https://sibeeshpassion.com/tag/create-screenshot-using-jquery/feed/" rel="self" type="application/rss+xml" />
	<link>https://sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Fri, 17 Jul 2015 12:50:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>create screenshot using jquery &#8211; Sibeesh Passion</title>
	<link>https://sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Generate Screenshot Using HTML and JavaScript</title>
		<link>https://sibeeshpassion.com/generate-screenshot-using-html-and-javascript/</link>
					<comments>https://sibeeshpassion.com/generate-screenshot-using-html-and-javascript/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 29 Dec 2014 19:27:11 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[create screenshot using jquery]]></category>
		<category><![CDATA[generate screenshot]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[screenshot]]></category>
		<category><![CDATA[take screenshot]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=711</guid>

					<description><![CDATA[Introduction Generate a screenshot using HTML and JavaScript, yeah that is what I meant. I was just searching for some unanswered article here, one member was asking about this, so I thought I would write a tip about that. Here it is, you can see the actual article reference here. Procedure Step 1 You need an HTML page with some JavaScript code andCSS. That&#8217;s all we need. Create an HTML file just like this: [html] &#60;html lang=“en”&#62; &#60;head&#62; &#60;title&#62;Take Web Page Screenshot with HTML5 and JavaScript &#60;/title&#62; &#60;/head&#62; &#60;body&#62; &#60;a class=“btn btn-success” href=“javascript:void(0);” onclick=“generate();”&#62;Generate Screenshot »&#60;/a&#62; &#60;/body&#62; &#60;/html&#62; [/html] Step [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>Generate a screenshot using HTML and JavaScript, yeah that is what I meant. I was just searching for some unanswered article here, one member was asking about this, so I thought I would write a tip about that. Here it is, you can see the actual article reference <a href="http://www.xpertdeveloper.com/2012/10/webpage-screenshot-with-html5-js/" rel="nofollow">here</a>.</p>
<p><strong>Procedure</strong></p>
<p><strong>Step 1</strong></p>
<p>You need an HTML page with some JavaScript code andCSS. That&#8217;s all we need.</p>
<p>Create an HTML file just like this:</p>
<p>[html]<br />
&lt;html lang=“en”&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Take Web Page Screenshot with HTML5 and JavaScript &lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;a class=“btn btn-success” href=“javascript:void(0);” onclick=“generate();”&gt;Generate<br />
        Screenshot »&lt;/a&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Step 2</strong></p>
<p>If you want, you can create some styles and apply them.</p>
<p>Now it&#8217;s time to create the JavaScript function generate() that I specified in an &lt;a&gt; tag.<br />
[html]<br />
&lt;script type=“text/javascript”&gt;<br />
        (function (exports) {<br />
            function urlsToAbsolute(nodeList) {<br />
                if (!nodeList.length) {<br />
                    return [];<br />
                }<br />
                var attrName = ‘href’;<br />
                if (nodeList[0].__proto__ === HTMLImageElement.prototype || nodeList[0].__proto__ ===<br />
                 HTMLScriptElement.prototype) {<br />
                    attrName = ‘src’;<br />
                }<br />
                nodeList = [].map.call(nodeList, function (el, i) {<br />
                    var attr = el.getAttribute(attrName);<br />
                    if (!attr) {<br />
                        return;<br />
                    }<br />
                    var absURL = /^(https?|data):/i.test(attr);<br />
                    if (absURL) {<br />
                        return el;<br />
                    } else {<br />
                        return el;<br />
                    }<br />
                });<br />
                return nodeList;<br />
            }<br />
            function screenshotPage() {<br />
                urlsToAbsolute(document.images);<br />
                urlsToAbsolute(document.querySelectorAll(“link[rel=’stylesheet’]”));<br />
                var screenshot = document.documentElement.cloneNode(true);<br />
                var b = document.createElement(‘base’);<br />
                b.href = document.location.protocol + ‘//’ + location.host;<br />
                var head = screenshot.querySelector(‘head’);<br />
                head.insertBefore(b, head.firstChild);<br />
                screenshot.style.pointerEvents = ‘none’;<br />
                screenshot.style.overflow = ‘hidden’;<br />
                screenshot.style.webkitUserSelect = ‘none’;<br />
                screenshot.style.mozUserSelect = ‘none’;<br />
                screenshot.style.msUserSelect = ‘none’;<br />
                screenshot.style.oUserSelect = ‘none’;<br />
                screenshot.style.userSelect = ‘none’;<br />
                screenshot.dataset.scrollX = window.scrollX;<br />
                screenshot.dataset.scrollY = window.scrollY;<br />
                var script = document.createElement(‘script’);<br />
                script.textContent = ‘(‘ + addOnPageLoad_.toString() + ‘)();’;<br />
                screenshot.querySelector(‘body’).appendChild(script);<br />
                var blob = new Blob([screenshot.outerHTML], {<br />
                    type: ‘text/html’<br />
                });<br />
                return blob;<br />
            }<br />
            function addOnPageLoad_() {<br />
                window.addEventListener(‘DOMContentLoaded’, function (e) {<br />
                    var scrollX = document.documentElement.dataset.scrollX || 0;<br />
                    var scrollY = document.documentElement.dataset.scrollY || 0;<br />
                    window.scrollTo(scrollX, scrollY);<br />
                });<br />
            }<br />
            function generate() {<br />
                window.URL = window.URL || window.webkitURL;<br />
                window.open(window.URL.createObjectURL(screenshotPage()));<br />
            }<br />
            exports.screenshotPage = screenshotPage;<br />
            exports.generate = generate;<br />
        })(window);<br />
    &lt;/script&gt;<br />
[/html]</p>
<p><strong>Complete Code</strong></p>
<p><strong>Screenshot.html</strong><br />
[html]<br />
&lt;html lang=“en”&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Take Web Page Screenshot with HTML5 and JavaScript &lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;a class=“btn btn-success” href=“javascript:void(0);” onclick=“generate();”&gt;Generate<br />
        Screenshot »&lt;/a&gt;<br />
    &lt;script type=“text/javascript”&gt;<br />
        (function (exports) {<br />
            function urlsToAbsolute(nodeList) {<br />
                if (!nodeList.length) {<br />
                    return [];<br />
                }<br />
                var attrName = ‘href’;<br />
                if (nodeList[0].__proto__ === HTMLImageElement.prototype || nodeList[0].__p                   roto__ === HTMLScriptElement.prototype) {<br />
                    attrName = ‘src’;<br />
                }<br />
                nodeList = [].map.call(nodeList, function (el, i) {<br />
                    var attr = el.getAttribute(attrName);<br />
                    if (!attr) {<br />
                        return;<br />
                    }<br />
                    var absURL = /^(https?|data):/i.test(attr);<br />
                    if (absURL) {<br />
                        return el;<br />
                    } else {<br />
                        return el;<br />
                    }<br />
                });<br />
                return nodeList;<br />
            }<br />
            function screenshotPage() {<br />
                urlsToAbsolute(document.images);<br />
                urlsToAbsolute(document.querySelectorAll(“link[rel=’stylesheet’]”));<br />
                var screenshot = document.documentElement.cloneNode(true);<br />
                var b = document.createElement(‘base’);<br />
                b.href = document.location.protocol + ‘//’ + location.host;<br />
                var head = screenshot.querySelector(‘head’);<br />
                head.insertBefore(b, head.firstChild);<br />
                screenshot.style.pointerEvents = ‘none’;<br />
                screenshot.style.overflow = ‘hidden’;<br />
                screenshot.style.webkitUserSelect = ‘none’;<br />
                screenshot.style.mozUserSelect = ‘none’;<br />
                screenshot.style.msUserSelect = ‘none’;<br />
                screenshot.style.oUserSelect = ‘none’;<br />
                screenshot.style.userSelect = ‘none’;<br />
                screenshot.dataset.scrollX = window.scrollX;<br />
                screenshot.dataset.scrollY = window.scrollY;<br />
                var script = document.createElement(‘script’);<br />
                script.textContent = ‘(‘ + addOnPageLoad_.toString() + ‘)();’;<br />
                screenshot.querySelector(‘body’).appendChild(script);<br />
                var blob = new Blob([screenshot.outerHTML], {<br />
                    type: ‘text/html’<br />
                });<br />
                return blob;<br />
            }<br />
            function addOnPageLoad_() {<br />
                window.addEventListener(‘DOMContentLoaded’, function (e) {<br />
                    var scrollX = document.documentElement.dataset.scrollX || 0;<br />
                    var scrollY = document.documentElement.dataset.scrollY || 0;<br />
                    window.scrollTo(scrollX, scrollY);<br />
                });<br />
            }<br />
            function generate() {<br />
                window.URL = window.URL || window.webkitURL;<br />
                window.open(window.URL.createObjectURL(screenshotPage()));<br />
            }<br />
            exports.screenshotPage = screenshotPage;<br />
            exports.generate = generate;<br />
        })(window);<br />
    &lt;/script&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Conclusion</strong></p>
<p>Please share me your valuable suggestions and feedback.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/generate-screenshot-using-html-and-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
