Skip to content

Instantly share code, notes, and snippets.

@stevefaulkner
Created March 6, 2019 18:44
Show Gist options
  • Save stevefaulkner/c7087f72af0517dd60ffbd65acb850f8 to your computer and use it in GitHub Desktop.
Save stevefaulkner/c7087f72af0517dd60ffbd65acb850f8 to your computer and use it in GitHub Desktop.
Check serialized DOM for the current page bookmarklet
javascript:(function(){function%20c(a,b){var%20c=document.createElement("textarea");c.name=a;c.value=b;d.appendChild(c)}var%20e=function(a){for(var%20b="",a=a.firstChild;a;){switch(a.nodeType){case%20Node.ELEMENT_NODE:b+=a.outerHTML;break;case%20Node.TEXT_NODE:b+=a.nodeValue;break;case%20Node.CDATA_SECTION_NODE:b+="<![CDATA["+a.nodeValue+"]]\>";break;case%20Node.COMMENT_NODE:b+="<\!--"+a.nodeValue+"--\>";break;case%20Node.DOCUMENT_TYPE_NODE:b+="<!DOCTYPE%20"+a.name+">\n"}a=a.nextSibling}return%20b}(document),d=document.createElement("form");d.method="POST";d.action="http://validator.w3.org/nu/";d.enctype="multipart/form-data";d.target="_blank";d.acceptCharset="utf-8";c("showsource","yes");c("showoutline","yes");c("content",e);document.body.appendChild(d);d.submit()})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment