I'm currently developing a firefox extension. I use dump() function. But the messages are not showing up in the console. I've cahnged the value of browser.dom.window.dump.enabled to true in about:config and restarted firefox from command linelike firefox.exe -console. Still i cant see the dump() message. What is possibly wrong?
Btw, Is there any addon which can show the dump() messages without having to restart firefox in command line firefox -console?
Starting Firefox with -console command line switch is only necessary on Windows. If you are using Linux then you should simply start Firefox from a terminal window. On Mac OS X the console messages can be displayed via some application (sorry, don't remember which one). Also, changing browser.dom.window.dump.enabled is only necessary if you are logging from a window-bound context - in JavaScript modules and such it always works regardless of this preference.
If you want to have your logging messages available more easily you should be using Components.utils.reportError() (or nsIConsoleService.logStringMessage() as explained in the documentation) - this will send messages to the usual Error Console that can be opened at any time.
I find this addon to be really helpful when logging errors/messages to the console: https://addons.mozilla.org/en-US/firefox/addon/console%C2%B2/
To finally get the output from dump(), I specified dump file location by creating a preference browser.dom.window.dump.file and setting it in about:config.
I believe I had the same issue. I couldn't get dump() to print to stderr nor the console even though I had set browser.dom.window.dump.enabled to true. I'm on Ubuntu 14.04.
Source:
https://developer.mozilla.org/en-US/docs/Mozilla/Preferences/Preference_reference/browser.dom.window.dump.file
Related
I am running program which open "chromium-browser" with following command-line parameters in Linux.
--incognito = Causes the browser to launch directly in incognito mode. ↪
--no-first-run = Skip First Run tasks, whether or not it's actually the First Run. Overridden by kForceFirstRun.
This does not drop the First Run sentinel and thus doesn't prevent first run from occuring the
next time chrome is launched without this flag.
--disable-save-password-bubble
--password-store = Specifies which password store to use (detect, default, gnome, kwallet).
--password-store=basic
--no-default-browser-check = Disables the default browser check. Useful for UI/browser tests where we want to avoid having
the default browser info-bar displayed.
--window-size = Specify the initial window size: --window-size=w,h
--window-size=1024,1024
--app = Specifies that the associated value should be launched in "application" mode.
Now I want to do the same thing with "firefox" browser. I need help to find firefox command-line parameter for firefox which is similar to chromium-browser.
I searched firefox website but not able to find alternatives for same.
Try to look them up here Mozilla - Command Line Options remember: Mozilla is the umbrella organisation of firefox, thunderbird, ... so this looks like the normative documentation place - the reality check then will be the installed binary, but then you can file issues in the tracker (if an option similar to these needed by you is documented but does not work).
Update 2021-08-30: Note that the options page is in archive status and there may be non-listed options available or listed options missing with newer versions. Until the Mozilla / Firefox project comes up with a maintained manual page on these options a good way to ensure what options are supported is to call firefox on the command line with the --help parameter.
You can try to check this one
this works as of 21/10/21
You would also want to look at the '-kiosk' argument
(similar to the chromium '--app' arg) which isn't really documented in the pages referenced in other comments here.
https://support.mozilla.org/en-US/kb/firefox-enterprise-kiosk-mode
I understand that I can log to the console when using a Firefox extension with the cfx run command.
Is there a way to log to a console after the extension has been packaged with cfx xpi? Logging to Firebug is fine if possible.
I have found two blog posts about this (here and here). Both are rather old and don't work any more.
I'm using version 1.10 of the add-on SDK and FF15.
You need to do 2 things:
enable logging for addons
• in about:config, add a new option extensions.sdk.console.logLevel and give it the value "all"
• restart Firefox
in Firefox open the Browser Console:
• Tools -> Web developer -> Browser console
• NOTE: this is different from the usual Web Console used to debug web pages
You should see addons logs there now.
TLDR:
Go to about:config url and create key extensions.sdk.console.logLevel with value all
See log messages either in Browser console (Ctrl+Shift+J) or in terminal you started Firefox from.
cfx or its successor jpm creates this configuration key automatically in development firefox profile.
From logging documentation:
extensions.sdk.console.logLevel: if set, this determines the logging level for all installed SDK-based add-ons.
extensions.extensionID.sdk.console.logLevel, where extensionID is an add-on's Program ID. If set, this determines the logging level for
the specified add-on. This overrides the global preference if both
preferences are set.
I will summarize recent changes that has taken with Firefox since this question got posted -- basically updated #LucaBonavita answer.
In about:config, check if option extensions.sdk.console.logLevel is enabled. If not, toggle to enable. You might need to create it if it does not exist
Open Browser Console
Menu Bar -> Tools -> Browser Tools -> Browser Console
Enable Show Content Messages in browser console.
Now, console.log triggered by Firefox addon/extension should display
Tested on Firefox 94.0.2 (64-bit) and 95.0b12 (64-bit)
Have you tried console.log() with Firebug? (I know you have tried Application.console.log() and Firebug.console.log() already)
I just tried it in the Web Console on FF16 running Firebug 1.10.4 and it seems to work:
Here are some more examples from the Firebug Wiki itself: FirebugWiki Console API
Additionally, you can write messages of different types in the console, such as: console.debug(), console.info(), console.warn(), console.error()
If you run console.log from Add-on code, it send up in the 'Messages' tab of the Error Console window:
I have been developing an AJAX application using jQuery and Microsoft Seadragon technology.
I need to have access to the html5 canvas function toDataURL.
With Google Chrome, the same origin rule applies to this function which means that a page run locally (with the file:/// in the URL) failed to satisfy the same origin rule and an exception is thrown.
With Chrome 7, starting the application with --allow-file-access-from-files option, allows to call canvas.toDataURL() from local files.
However, it seems that starting the Chrome Beta 8 with the same option (--allow-file-access-from-files) does not allow the call canvas.toDataURL() on the local file.
Does Chrome gave up on the --allow-file-access-from-files option or it has just been disabled since it is a Beta release and not a full release?
Thanks!
Looking at the issues for this shows that the whole --allow-file-access-from-files thing was rushed.
"Firefox does it.."
"How can we do it?"
some time passes
"Here are the patches"
"Passes! On trunk wonder what happens in the next dev release"
"Ahhh it's broken" "Use the command line option" "ok"
"We shipped!"
"WTF guys? You broke all my stuff! Why didn't you tell us earlier?"
silence
On to your Problem
Indeed it seems that this is something special to the beta, I'm using Chrome 8.0.552.5 dev here and --allow-file-access-from-files works like expected, I've also tested this with Chromium 9.0.592.0 (66889) were it also works as expected.
I suspect there have been some changes on the dev branch. Unfortunately, finding something on chromium's issue tracker is nearly impossible.
Did you close all chrome instances before opening with the command line argument? You have to do that to make that parameter work.
To summarize all answers so far.
Before running chrome, make sure there are no chrome processes running.
Windows
-allow-file-access-from-files
(with one dash)
Linux
--allow-file-access-from-files
(with two dashes)
I've found a way around the issue using a JavaScript/Flash approach. If flash is compiled in the Local Only security sandbox, it has full access to local files. Using ExternalInterface, JavaScript can request a Flash Application to load a file, and Flash can pass the result back to JavaScript.
You can find my implementation here: https://code.google.com/p/flash-loader/
The trick that woked for me is that you have to give the absolute path of the file and not just file name in your HTML code. e.g file://... instead of direct name even though you are accessing the file in the same directory. It will work!
Where does Firefox store the contents (text messages) of the Error Console. The errors, warnings, messages etc. are stored somewhere as Firefox retains them even if the browser is closed and re-opened.
I tried to search the entire profile folder but couldn't find out which file or sqlite DB these error console messages are written to ?
Does anyone have idea about this ?
Thanks in advance.
No, Error Console is cleared if you close Firefox and re-open it.
Error Console isn't tied to a particular browser window, so while Firefox runs, the messages are retained even if you close and open some windows. During the lifetime of the application, the messages are stored in memory (code link).
If you're looking for a way to dump messages that appear in the Error Console to a file, it's possible to do that, but I don't remember off-hand and don't want to look for it unless that's what you're interested in.
[edit The best I could find was this]
[edit] if you indeed see this, are you sure it's just base Firefox? Maybe it's some of the extensions you've installed? (Though it would be weird to implement messages persistence in the Error Console.)
I'm using Aptana Studio with Pydev 1.5.3 to debug my Django applications. I use PyDev's remote debugger and some code in manage.py and for most of the time this setup is working successfully- I can set breakpoints, inspect variables and step/continue through my code.
However, I'd like to execute arbitrary code at the breakpoint- the thing I really miss after switching from pdb to Eclipse debugging. There is an interactive console available in debug perspective but it is inactive for me.
So my question- is it possible to set up an interactive console in PyDev with remote debugger which could "inject" code at breakpoint?
strange, i am using pydev 1.5.6 for remote debugging and I can use the interactive console - i type the cmmand, hit enter, after a while get results back; check your firewall is not blocking anything (if you are sure, the interactive console works in local mode). there is even settings in pydev source code to set how much of stdout should be returned back to client (in chars), it should work
After some digging I discovered that I can use Expressions view to access variables properties and view results of class methods, but that still isn't a complete console at breakpoint though.
With PyDev 1.5.5 it should be possible:
In "Variables" view, you can right-click on a name, then select "change value".
The console is working as well, albeit a bit tricky.
It is only for inspection and in a very strange way: you have to input the text in the "Debug server" console, and you will get the output in the "filename" console.
Note also that you need to press enter twice, leaving an empty line.
While the "empty line" trick is documented, the issue about two different console for input and output is not, and I think it may be a bug.
On my development stack running Apache + mod_wsgi entering commands into the console had their output routed to the site's error logs. To resolve this you have set the stdoutToServer=True and sterrToServer=True to route capture all output to the PyDev remote debugger:
from pydevsrc import pydevd;pydevd.settrace('192.168.2.8', stdoutToServer=True, stderrToServer=True) #clone and put on python path: https://github.com/tenXer/PyDevSrc