When you write cl();
, you’re calling log
in the global context.
Chrome’s console.log
doesn’t want to be called on the window
object.
Instead, you can write
cl = function() { return console.log.apply(console, arguments); };
This will call log
in the context of console
.
More Related Contents:
- How to wait until an element exists?
- Chrome doesn’t delete session cookies
- How do I load an HTML page in a div using JavaScript?
- Chrome desktop notification example [closed]
- How does the paste image from clipboard functionality work in Gmail and Google Chrome 12+?
- “Uncaught TypeError: a.indexOf is not a function” error when opening new foundation project
- Chrome extension: How to save a file on disk
- How to getting browser current locale preference using javascript?
- getUserMedia() in chrome 47 without using https
- \u200b (Zero width space) characters in my JS code. Where did they come from?
- Wrong value in console.log [duplicate]
- How to make Google Chrome JavaScript console persistent?
- How to set breakpoints in inline Javascript in Google Chrome?
- How can I remove the “No file chosen” tooltip from a file input in Chrome?
- Is innerHTML asynchronous?
- How to clear cache of service worker?
- Checkbox Check Event Listener
- Problems downloading big file(max 15 mb) on google chrome
- javascript large integer round because precision? (why?)
- Chrome FileReader
- How do I send an HTTP GET request from a Chrome extension?
- Completely lost on how to save extension popup window content
- How to disable Chrome’s saved password prompt setting through JavaScript
- Is there a way to uniquely identify an iframe that the content script runs in for my Chrome extension?
- Can’t find serviceWorker in navigator anymore
- Javascript window.print() in chrome, closing new window or tab instead of cancelling print leaves javascript blocked in parent window
- How do I listen for triple clicks in JavaScript?
- How to develop Chrome extension for Gmail?
- How to open mailto links in new tab for users that have gmail as the default mail handler?
- How to to initialize keyboard event with given char/keycode in a Chrome extension?