For a userscript I need to clear a page including all of its styles, contents, events and timers. Is it possible to do that without redirecting to about:blank?
I tried document.body.remove(); document.head.remove(); but timers weren’t disable.
How can I clear the HTML page properly?
You can redirect to
"data:text/html,". This allows you to specify the HTML document to be rendered inside the URL.IE9 is the first version of Internet Explorer to support the Data URL for iframes and windows.
Reference: Data URI scheme#Web browser support on Wikipedia.