Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[magento] - fix console.log

fix console.log

Information

Remember to remove before deployment, as some users report it makes IE 7 crash

Layout.xml

In your local.xml add:

<default>
	<reference name="content">
		<block type="core/text" name="fix.console" as="fix.console">
			<action method="setText">
				<text><![CDATA[<script>
					iframe = document.createElement('iframe');
					iframe.style.display = 'none';
					document.getElementsByTagName('body')[0].appendChild(iframe);
					window.console = iframe.contentWindow.console;
					console.firebug = "faketrue";
				</script>]]></text>
			</action>
		</block>
	</reference>
</default>

Credits

Authors

Achim Rosenhagen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment