I use firebug a lot. However I do not like typing console.log all the time. I would rather type just log. So at the top of my console window I add this line all the time.
function log(){try{console.log.apply(console,arguments);}catch(e){}}
log(2 + 2);
I don't like to type that log statement every single time.
Is there a way I can tell either firefox or firebug to include that log function all the time.I guess I want to tinker with firebug and ask it to add that one function anytime it comes up live.
Any thoughts.
OK, this is probably a more complicated answer than you were after, but this is what I would do. I would build for myself a tiny Firefox extension which used an overlay to add a script into the windows which you are interested in, in this case the console window. The script would define anything you wanted in the context of this window, including your log() function. When Firefox opens the console window, it will run your script in this context, making the function available to you.
However, if you're not comfortable or experienced with creating Firefox extensions, this is unlikely to help in your particular case.
Have you tried to create a Greasemonkey script?
Related
I am very much glad if anyone help me. am fairly new to Unix scripting side. I am trying to get into one url, but before that am getting one popup window(asking for customer details). So, i need to block/disable/ auto close the popup window. Please help me with the command
In Unix environment shell command plays differently. It can launch your browser but it can not set utility inside a browser application. You need to fix it inside your browser window by using tool option. Just search in google like how to block popup in yourbrowserName.
I am going to write an application which runs in the background on windows platform. If user is working on any browser (IE, Firefox, Chrome, etc) and any of the user action results in downloading activity, the background program should take control. The background program pop-ups a window asking user, if they want to download. If user proceeds with OK, then background program sends signal to browser to stop its download process and the background program will do download. If user rejects download by the background program, then default download of browser can go on.
For this please suggest if any working model is there in c#/VB.NET/C++ or how to achieve this activity.
Will very much appreciate your kind help.
Thanking you very much in advance.
I don't think you understand the whole notion of downloading. Any resource you get from the Internet is downloaded. Hence, anything would trigger your application. You can, however, try to "parse" URL to see the extension but this does not have to mean nothing, since you can give any file an arbitrary extension (well not exactly arbitrary, but you know.. ). Another option is detecting FTP downloads ( i assume this might be of more interest ). This way you'd "only" have to check for a specific protocol. The reason i quoted only in the last sentence is that none of these tasks is a simple one.
You basically want to write a Proxy, or use an existing one.
You might wanna take a look at WinPcap
Finally, none of this options really give you the infromation whether user is going to download a file. But if you write a proxy, you could stop the endpoint application of obtaining that file once you download it.
I read an answer to a question on SO and someone suggested writing directly into the console. I thought, that sounds cool let's give it a go. I proceeded to make an attempt, but I couldn't figure it out. How do I write/run code directly in the console? I tried in Firebug & Firefox's inspector and I did a little Google search as well. Did I misunderstand something?
Firebug has two ways to execute some code (and write to the console). These are the Command Line at the bottom of the Console panel:
and the Command Editor if you want to write some larger scripts:
which is available by clicking the little arrow at the right side of the Console panel:
The Firefox DevTools have a similar feature to the Command Editor of Firebug called Scratchpad:
This tool is available via the Firefox menu > Developer > Scratchpad or by pressing Shift+F4.
MDN has some example about Outputting text to the console.
The most simple example is:
console.log("Hello World!"); Which should show up in the Firefox Console. (There might be some issue if you use Firebug at the same time)
I run a lot of automation using Firefox driver, and it takes a while (20-30 minutes). Naturally, while its running, I continue to work on something else.
However, while I doing things, I occasionally press the Shift key while a new Firefox instance is starting up. However, Firefox has hardcoded that it will boot in safe mode if you are holding shift, which then freezes automation in its "Are you sure you want to boot in safe mode?"
Here's the different options I've considered:
When I first ran into this, I thought that it was an issue with Firefox crashing multiple times. I changed toolkit.startup.max_resumed_crashes to 99999999 and browser.safebrowsing.enabled to false, both manually, and in my FirefoxProfile
I've tried this and this, both of which apparently refer to an old version of firefox, because the files they describe no longer exist.
This doesn't sound like it will work because profiles don't have anything to do with Safe Mode and I can't execute any AutoIt code because Selenium is still maintaining control as its frozen with the popup.
Running Firefox 3.6 or lower is not an option. Running headless is currently in the works (using Phantom), but we'll never stop running it with firefox. The same is true for the Grid (and I like running it local so I can actually see it run).
I've run into this enough times that I'm pretty desperate for any solution...whether that means changing something in my code, firefox settings, some files in the firefox folder, or even some AutoHotKey script (which I've considered, but don't know how it would work).
Thank you!
This solution you mentioned seems to work well for me even with the newest Firefox 22.
The omni.ja file is the one you want to unpack. It is a regular zip file.
Inside it:
Simply unpack, change the file, repack, save. Worked for me.
I wanted to have a GUI front-end for a script that accepts numerous command-line options, most of them are UNIX paths. So I thought rather than typing them in (even with auto-completion) every time, I'd create a GUI front end which contains text boxes with buttons beside them, which when clicked will invoke the file browser dialogue. Later, I thought I'd extend this to other scripts which would sure require a different set of GUI elements. This made me think if there's any existing app that would let me create a GUI dialog, after parsing some kind of description of the items that I want that window should contain.
I know of programs like Zenity, but I think it's doesn't give me what I want. For example, if I were to use it for the first script, it'll end up flashing sequence of windows in succession rather than getting everything done from a single window.
So, basically I'm looking at some corss-platform program that lets me create a window from a text description, probably XML or the like. Please suggest.
Thanks
Jeenu
Mozilla's XUL is a cross platform application framework - . You could write an app as a Firefox plugin or a standalone XUL application.
mono and monodevelop could work for this. Or even something super simple like shoes.