Created
August 11, 2015 17:45
-
-
Save SaladFork/c92655bf89d339aa8fd6 to your computer and use it in GitHub Desktop.
IE9 Console Shim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function initialize(/* container, application */) { | |
// IE9 doesn't define a console object until the development tools are opened. | |
// This causes hard-to-debug JavaScript errors for things like `console.log`. | |
window.console = window.console || {}; | |
window.console.log = window.console.log || function () {}; | |
window.console.info = window.console.info || function () {}; | |
window.console.warn = window.console.warn || function () {}; | |
window.console.error = window.console.error || function () {}; | |
// We also ensure that if we call newer console functions it doesn't break | |
// older browsers. | |
window.console.group = window.console.group || function () {}; | |
window.console.groupCollapsed = window.console.groupCollapsed || function () {}; | |
window.console.groupEnd = window.console.groupEnd || function () {}; | |
} | |
export default { | |
name: 'ie9-console-fix', | |
initialize: initialize | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment