!function(){function e(e){return d.call(e)}function t(e,t,n){try{p.call(e,t,n)}catch(c){}}function n(e,t){s.call(e,t)}function c(e){return m.call(e)}function r(e){for(;e.childNodes.length;)e.removeChild(e.lastChild)}function a(e,t,n){u.value.call(e,t,n)}function o(){var e=!0;try{f.innerHTML="<test/>"}catch(t){e=!1}return e}function i(o,i){function l(r){var a=e(r);if(a&&a.length){for(var o,i=0,p=a.length;p>i;i++){var s=a[i],u=s.name;"o"!==u[0]&&"O"!==u[0]||"n"!==u[1]&&"N"!==u[1]||(o=o||[],o.push({name:s.name,value:s.value}))}if(o)for(var i=0,p=o.length;p>i;i++){var s=o[i];n(r,s.name),t(r,"x-"+s.name,s.value)}}for(var d=c(r),i=0,p=d.length;p>i;i++)l(d[i])}var p=document.implementation.createHTMLDocument("cleaner");r(p.documentElement),MSApp.execUnsafeLocalFunction(function(){a(p.documentElement,"afterbegin",o)});var s=p.documentElement.querySelectorAll("script");Array.prototype.forEach.call(s,function(e){switch(e.type.toLowerCase()){case"":e.type="text/inert";break;case"text/javascript":case"text/ecmascript":case"text/x-javascript":case"text/jscript":case"text/livescript":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":e.type="text/inert-"+e.type.slice("text/".length);break;case"application/javascript":case"application/ecmascript":case"application/x-javascript":e.type="application/inert-"+e.type.slice("application/".length)}}),l(p.documentElement);var u=[];return"HTML"===i.tagName?u=Array.prototype.slice.call(document.adoptNode(p.documentElement).childNodes):(p.head&&(u=u.concat(Array.prototype.slice.call(document.adoptNode(p.head).childNodes))),p.body&&(u=u.concat(Array.prototype.slice.call(document.adoptNode(p.body).childNodes)))),u}function l(e,t){var n=Object.getOwnPropertyDescriptor(HTMLElement.prototype,e),c=n.set;Object.defineProperty(HTMLElement.prototype,e,{get:n.get,set:function(e){if(window.WinJS&&window.WinJS._execUnsafe&&o())c.call(this,e);else{var r=this,a=i(e,r);MSApp.execUnsafeLocalFunction(function(){t(n,r,a)})}},enumerable:n.enumerable,configurable:n.configurable})}if(window.MSApp&&MSApp.execUnsafeLocalFunction){var p=Object.getOwnPropertyDescriptor(Element.prototype,"setAttribute").value,s=Object.getOwnPropertyDescriptor(Element.prototype,"removeAttribute").value,u=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"insertAdjacentHTML"),d=Object.getOwnPropertyDescriptor(Node.prototype,"attributes").get,m=Object.getOwnPropertyDescriptor(Node.prototype,"childNodes").get,f=document.createElement("div");l("innerHTML",function(e,t,n){r(t);for(var c=0,a=n.length;a>c;c++)t.appendChild(n[c])}),l("outerHTML",function(e,t,n){for(var c=0,r=n.length;r>c;c++)t.insertAdjacentElement("afterend",n[c]);t.parentNode.removeChild(t)})}}();