I am extending Google Chrome using the "chrome.devtools.panels.create" API, which means that I now have some kind of logic in my browser that I need to debug.
Anyway, to see the Console / Debug tab of my DevTools add-ons?
If you need just console.log , you can wrap it. It actually works for any other function, not just console.log , but here is an example for wrapping console.log :
console.log
console._log = console.log; console.log = function(){ // you can do whatever you want with arguments, output to div, alert / etc. return console._log.apply(console,arguments); };
You need to define a script in a checked window:
chrome.devtools.inspectedWindow.eval('console.log("test")')
Source: https://habr.com/ru/post/918486/More articles:Is it cutting if statements using function pointers are more efficient? - c ++Can I conditionally replace preprocessor arguments? - c ++How to change XML namespace of a specific element - c #Android NDK - using AssetManager in native code - androidHow to access elements in different frames? - javascriptevaluating DBNull: checking for equality or using the is operator? - c #How do Europeans write a list of numbers with decimal places? - number-formattingChain commands on the PowerShell command line (for example, POSIX sh &&) - shellto create an object before calling super in java - javaHomepage label value does not receive an updated form on the content page - c #All Articles