I need to save Firebug's or the Google Chrome Console panel's log. I tried console.log() to play with printing logs, but what I need is to programatically save these developer tools logs into files.
Firebug has an extension called ConsoleExport, which does exactly that.
This extension exports the messages logged to Firebug's console in XML format. In the current released version 0.5b5 it only auto-exports to a server URL. Though, in the meantime code landed already (see issue 9) to auto-export to the file system, which will (hopefully) be released soon (see issue 21).
Related
I have a little userscript running on Tampermonkey in Firefox (chrome has the same behavior)
The xhr logs of these requests doesn't appear in the console or network analysis.
Because it is a cors request from https to a http service, we have to use GM_xmlhttpRequest() and cannot use fetch() or normal XmlHttpRequest
The request report sometimes an error and sometimes not, so the information would be very helpful to solve our issue.
My question is, where I can find these logs, or how can I turn it on?
GM_xmlhttpRequest() is usually run from the background script of the userscript manager.
As mentioned in the following topic, you can open the relative console and check the Network tab.
Can't get Firefox extension logs to show up
Firefox console has been divided into different areas. The result of
console.log() can be viewed in the relative area.
Multiprocess Browser Console Ctrl+Shift+J Mostly logs by Firefox itself
Web Developer Tools Ctrl+Shift+I or F12 Logs by Tab/Webpage and Content scripts of addons
Extension Toolbox about:debugging#/runtime/this-firefox ➜ XYZaddon ➜ Inspect Logs by background scripts of XYZaddon
Where console.log('') gets printed, if I don't have a local setup and working on code inside the browser.
you can see the output in the Developer console. In Firefox and Chrome browsers for example - hit CTRL-SHIFT-I and it pops up - then go to ...Console..JS and you can see what you console.log() there
Beyond that (eg. client and runtime logs) see How do I see the logs for Fabric Composer
Writing console.log in a Transaction can be used to debug and see the incoming and outgoing data. It can be viewed using developer options by pressing Ctrl+Shift+i in Chrome or Firefox.
But if you are using Composer Playground locally, then the log output is written to the Docker Container.
Now that Firebug has been subsumed into Firefox, how can I configure the browser to bring Javascript errors to my attention without having the console open all the time, as Firebug used to do by showing an error count on its toolbar icon?
The Firefox DevTools provide a so-called "Developer Toolbar" aka GCLI (openable via Firefox menu > Developer > Developer Toolbar or Shift + F2), which displays the number of errors on the page (besides providing many useful commands):
Update:
The DevTools team obviously plans to remove the Developer Toolbar, because of low usage and because it's unmaintained and for most of it's features are available somewhere else.
There is no replacement yet for the error count, though, but a comment on the related bug report indicates that it will be added back.
Another options is to use Chrome extension JavaScript Errors Notifier.
To install it in Firefox, you'll first have to install another extension Chrome Store Foxified, which enables you to install any Chrome extension from Chrome Web Store to Firefox. You can follow the instructions of Chrome Store Foxified to install the extensions you like. (Note that not all Chrome extensions will work in Firefox.)
If you want to install the Chrome extension permanently, you'll have to sign up with Mozilla to get the extension signed.
If the JavaScript Errors Notifier extension is successfully installed in Firefox, you'll see an icon appearing at the right end of the address bar.
And when there's any JavaScript error in the page, the icon will turn red. To see the details of the errors, you can click on the icon. And the extension have quite some options to tune the errors that you want to get alerted.
Google Chrome v48.0.2564.116 (64-bit) for Mac OS seems to retain all console commands indefinitely. None of the following have any affect:
clear()
console.clear()
Command-K
turning off "preserve log" and "show all messages"
Clear browsing data, from the beginning of time, all options check marked - removing all cookies
quitting and restarting or shutting down and rebooting.
Any combo of the above.
Unable to locate a chrome_debug.log file anywhere on the system (i.e. logging is not check marked).
Trashing Google Chrome and the associated library files then re-installing got rid of the console history, but the new version nonetheless holds all console subsequent console entries indefinitely.
Any insights? Any idea where this information gets stored?
If you are using windows 10. Just Simply go the console and right click then click on clear console
Thanks to Karmiphuc and the following link:
How to remove all recent console command
which mostly answers the question.
It's slightly understated there that, on Mac OS at least, you have to call the developer tools twice consecutively.
So 1st pull up a browser window, and do Command-Shift-I (Mac shortcut).
Then, making sure the Developer Tools window is undocked, do a second Command-Shift-I which pulls up yet another Developer Tools window.
Now look under Local Storage > chrome-devtools://devtools > consoleHistory.
I'm trying to use Firebug to debug a JavaScript file in an extension I've added to Fx 4.
Can anyone tell me how to do it? I can only see website scripts.
Use Chromebug it's firebug for extension development, witch will give you the full ability to inspect debug firefox it self and all firefox extension as if it's a webpage :)
1- install the latest version from here: http://getfirebug.com/releases/chromebug/
2- Winkey+R to open run then type firefox.exe -chromebug this will run firefox with chromebug
3- for more information visit http://getfirebug.com/wiki/index.php/Chromebug
Please see MDN - Building An Extension - Debugging Extensions, which shows what tools Firefox provides you with to natively debug extension, also take a look at Dive Into Greasemonkey - Debugging User Scripts (PDF, p.13) which is aimed more specifically at your request.
Other than that, see How to debug a Greasemonkey script with the Firebug extension?
On Firefox 19 or later, it's possible to use the built-in JS debugger on the browser itself. Go to about:config and set the following two prefs:
devtools.chrome.enabled: true
devtools.debugger.remote-enabled: true
After you restart the browser, you can access the Browser Debugger through Tools > Web Developer > Browser Toolbox.
(note that you must accept the incoming connection)
See more at: https://developer.mozilla.org/en-US/docs/Mozilla/Debugging/Debugging_JavaScript#JavaScript_Debugger
In the bottom right hand corner there should be a little Firebug icon. Single or double click to open then you see some tabs at the top. Click the "Console" tab for real time debugging, or the "SCript" tab to view the scripts that have been loaded. Note, you can also load CSS and HTML through Firebug, use the "Viewer" icon to view HTML code on the page in real time.