Change
o.printToConsole(console.log);
to
o.printToConsole(console.log.bind(console));
or
o.printToConsole(function(){ console.log.apply(console.log, arguments) });
The console.log
function only works when the receiver (this
) is the console (in fact, it’s browser dependent).
More Related Contents:
- Official locator strategies for the webdriver
- Use a content script to access the page context variables and functions
- Weird behavior with objects & console.log [duplicate]
- Can a website detect when you are using Selenium with chromedriver?
- Suppress Chrome ‘Failed to load resource’ messages in console
- Jquery load() only working in firefox?
- Chrome Uncaught Syntax Error: Unexpected Token ILLEGAL [duplicate]
- Get element CSS property (width/height) value as it was set (in percent/em/px/etc)
- Violation Long running JavaScript task took xx ms
- How can I add predefined length to audio recorded from MediaRecorder in Chrome?
- How to disable JavaScript in Chrome Developer Tools?
- Unexpected token ILLEGAL in webkit
- Injecting JS functions into the page from a Greasemonkey script on Chrome
- Does execCommand SaveAs work in Firefox?
- Chrome extension: How to remove orphaned script after chrom extension update
- How to keep Google Chrome Extension popup open?
- What happens to code after a javascript redirect (setting window.location.href)?
- ‘load’ event not firing when iframe is loaded in Chrome
- Is it possible to control the camera light on a phone via a website?
- Forcing garbage collection in Google Chrome
- Can’t trigger click with jQuery in a Chrome extension
- Function as Google Chrome bookmark
- How to detect if user has enabled full screen in browser
- Re-enabling window.alert in Chrome
- iframe not reading cookies in Chrome
- Keycode is always zero in Chrome for Android
- Disable chrome react DevTools for production
- Record voice from IPhone using HTML5
- How to use “segments” mode at SourceBuffer of MediaSource to render same result at Chomium, Chorme and Firefox?
- Chrome developer tools do not show all JavaScript files any more