Tworzenie / znajdowanie bookmarkletu walidatora HTML5

Chcę znaleźć lub utworzyć bookmarklet, który sprawdzi zawartość html aktualnie oglądanej strony za pomocą walidatora W3C HTML 5.

Znalazłem dwa bookmarklety i staram się, aby ktoś zachowywał się trochę jak jeden i trochę jak drugi, jednak nie jestem pewien, jak to zrobić.

Chris Coyier maBookmarklet sprawdzania poprawności HTML5 działa dobrze, ale używa identyfikatora URI strony, więc nie działa dla lokalnie testowanych witryn:

<code>javascript:(function(){%20function%20fixFileUrl(u)%20{%20var%20windows,u;%20windows%20=%20(navigator.platform.indexOf("Win")%20!=%20-1);%20%20/*%20chop%20off%20file:///,%20unescape%20each%20%hh,%20convert%20/%20to%20\%20and%20|%20to%20:%20*/%20%20u%20=%20u.substr(windows%20?%208%20:%207);%20u%20=%20unescape(u);%20if(windows)%20{%20u%20=%20u.replace(/\//g,"\");%20u%20=%20u.replace(/\|/g,":");%20}%20return%20u;%20}%20/*%20bookmarklet%20body%20*/%20var%20loc,fileloc;%20loc%20=%20document.location.href;%20if%20(loc.length%20>%209%20&&%20loc.substr(0,8)=="file:///")%20{%20fileloc%20=%20fixFileUrl(loc);%20if%20(prompt("Copy%20filename%20to%20clipboard,%20press%20enter,%20paste%20into%20validator%20form",%20fileloc)%20!=%20null)%20{%20document.location.href%20=%20"http://validator.w3.org/file-upload.html"%20}%20}%20else%20document.location.href%20=%20"http://validator.w3.org/check?uri="%20+%20escape(document.location.href);%20void(0);%20})();
</code>

Znalazłem również ten, który działa poprzez złapanie html bieżącej strony, ale nie mogę zrozumieć, jak zrobić to html5 ... w kodzie jest odniesienie do doctype i próbowałem zmienić to na html5, html500 itp. i usunięcie go całkowicie z nadzieją, że automatycznie wykryje ... ale bezskutecznie:

<code>javascript:(function(){var h=document;var b=h.doctype;var e="<!DOCTYPE "+b.name.toLowerCase()+' PUBLIC "'+b.publicId+'" "'+b.systemId+'">\n';var g=h.documentElement.outerHTML;var f="http://validator.w3.org/check";var i={prefill_doctype:"html401",prefill:0,doctype:"inline",group:0,ss:1,st:1,outline:1,verbose:1,fragment:e+g};var a=h.createElement("form");a.setAttribute("method","post");a.setAttribute("target","_blank");a.setAttribute("action",f);for(var j in i){var c=h.createElement("input");c.setAttribute("type","hidden");c.setAttribute("name",j);c.setAttribute("value",i[j]);a.appendChild(c)}if(navigator.appCodeName=="Mozilla"){h.body.appendChild(a)}a.submit()})();
</code>

questionAnswers(4)

yourAnswerToTheQuestion