MozRepl

MozRepl documentation has moved. Go to the new home »

Connect to Firefox and other Mozilla apps, explore and modify them from the inside, while they're running.

Execute Javascript, play with browser GUI, sneak into HTML pages, examine functions and variables, redefine them on the fly, hot-fix bugs, ... MozRepl itself is programmable from within MozRepl.

MozRepl is part of MozLab.

Watch the video: Exploring the browser, online docs, entering web pages, modifying the REPL

Not bad. But still, aside from all the niceties which will surely come, I still still still hope that one day I can use a language such as ruby instead of Javascript to control the aspects ... even if i use it only locally ;)

Well why don't you get on that then.

Dude, that's absolute coolness. Thanks for this great piece of work.

Woah. Thanks! :-)

this rocks, reload current page from inside emacs with one keystroke, you have saved me a million <ctrl> <x> <s> , <alt> <tab>, <ctrl> <r>, <alt> <tab>

Awesome, I love this. I use it all the time! Great work!

I am looking for a MoxRepl - Python module. Does it exist?

I would have loved to have used this, but on XP after I telnet in, it just attempts to process every keystroke I type in the telnet session vs waiting for a cr/lf, is there something I'm doing wrong? Seems like I can't type a single word, as each keystroke gets processed, i.e. if I try to type quit

repl> q @data:application/x-javascript,q:1 !!! ReferenceError: d is not defined

repl> u @data:application/x-javascript,u:1 !!! ReferenceError: d is not defined

repl> i @data:application/x-javascript,i:1 !!! ReferenceError: d is not defined

repl> t @data:application/x-javascript,t:1 !!! ReferenceError: d is not defined

Hi,

check out the first item on the page about troubleshooting.

I am also experiencing the problem described by Steveorevo, every key stroke is getting the Reference error despite entering a ; as the first character or last or anywhere in between, what can solve this?

Quoting from the troubleshooting page:


On Windows, telnet will probably start in character-at-a-time mode. To put it into line-at-a-time mode, press the escape combination (usually Control+]) and enter the command:
set mode console
Windows 2000 telnet has been reported to have no such option. If that is the case, try putty instead.

If I want to get the entire page html dump (including those in IFrame, Frame & those that is generated by the javascript), is it possible with REPL?

You can get a document dump using something like:


var dump = (new XMLSerializer()).serializeToString(document);

For iframes, the containing document only has the tag, so you'd have to get and dump the frame documents separately.

Thks bard, it do provide a good pointer.

however, i am still abit lost, Probably this is due to the dom object modeling inside firefox get me confused.

using javascript, if we wanted to get reference to the frames, we can do it just by typing:
document.FRAME_NAME.etc.etc

I tried to do it using repl, but it can't dump the frame documents. am I doing the right way?

thks in advance.

I found the way to do it, via the frames arrays to access the frames documents.

Here is another question, can we possible to control an event for a particular dom element? e.g. I would like to click on a button, or click on a link etc. etc.

Do we need to write the custom function (I believed jquery is doing it) for repl? or it is supported by itself?

thanks in advance.

I managed to get the click event handler on the dom using custom script (basically the custom script is only used to shorten the typing in repl.

Soon after finishing it, I finally managed to run tru my application entirely via repl. But I encounter issue with page loading.

Currently when there is javascript/links that we click/execute that changes the documents of a certain pages (e.g. from www.google.com going to www.yahoo.com), the call return directly even though the latter pages is not yet displayed.

Not sure this is the right place to ask, it more sounded like the mozilla things, but just to keep everything in one place, how do we listen to the page load? how do repl console get notify when pages are finish loading?

For information, I am scripting using telnet as interface, connected tru repl to control pages in my application.

Yes, it's not MozRepl-specific, but to listen for web page loads when you are in chrome (like you are when you're using MozRepl) one way might be:


getBrowser().addEventListener('load', function(event) {
    myOnLoadHandler(event); 
}, true);

Keep in mind that myOnLoadHandler will be invoked on every page load, not just the next one.

You can probably find useful snippets on http://developer.mozilla.org and perhaps something in the archive of http://groups.google.com/group/mozlab.

I'm trying to update a project that was working with MozLab 0.18 to 0.19. I was having some problems, so I tried accessing manually.

I found that if I open a telnet session and paste in more than 1024 characters of javascript code into the telnet window the connection is dropped with no errors being given. Is this a problem with MozRepl?

Hey, MozRepl looks like THE tool that will allow me to enjoy JS hacking. However, my Firefox 3 says I cannot install it. Is it something important, or just the matter of changing versions the add-on is supposed to work with? Please, make my life suck less! :-)


I found that if I open a telnet session and paste in more than 1024 characters of javascript code into the telnet window the connection is dropped with no errors being given. Is this a problem with MozRepl?

I don't see that problem here. Does it happen consistently with >1024 characters, regardless of the content? Does it happen across clients too (netcat, telnet, putty...)?

@ryszard: Try 0.2 from this site, should fix it. :-)

@bard: You are my hero. MozRepl has just made my life less miserable by an order of magnitude. BTW do you know Slime, the Common Lisp emacs uebermode? It's given me the best programming experience ever, and MozRepl looks like a step in that direction.

@ryszard, I know Slime, it's for a large part the work of one of my heroes. :) Saying that MozRepl is a step in that direction is possibly the best compliment you could give it, thanks. :)

Can someone point me to the install instructions. I'm testing with w3af and it requires mozrepl, so I downloaded and don't see instructions. All links point to git, but don't see how to install. thx

Just click on http://repo.hyperstruct.net/mozrepl/devel/mozrepl.xpi from Firefox, it will get installed.

Hi. It seems to be the exact tool i was in need for. I only have one question : is it possible to save a picture using it? I need to browse a given site, and save a picture to disk for processing. I guess it's possible but i don't get how. Thanks for this very nice tool!

@john: sure, MozRepl gives you access to Firefox internals, so whatever you can do from Firefox GUI, you can do from MozRepl. Just have a look at Firefox sources to see how it does it and issue the same commands to MozRepl...

Been using MozRepl for a while and am not a Firefox internals expert. So, I'm asking for help.

Will paypal $300 to the first person who posts a comment here giving the MozRepl commands to:
(a) Clear the cache, history and cookies (with no popup confirmation dialogs, etc).
(b) Command Firefox to exit (completely close down the firefox process).

Thanks in advance,

Douglas M Dillon, Assistant Vice President, Software Engineering, Hughes

Never mind about that bounty. If found the recipe after an hour of googling.

Thanks anyway. What a great contribution to the community MozRepl is.

Douglas M Dillon

Can someone point me to the install instructions. I'm testing with w3af and it requires mozrepl, so I downloaded and don't see instructions. All links point to git, but don't see how to install. thx

Follow the instructions on http://wiki.github.com/bard/mozrepl (basically just click on the link from Firefox).

This is a great app!

One question though, why is only the only older version firefox 2 available on the extension page?

Thanks, stefan

Lack of time on my side to keep it updated, I'm afraid. It takes a single shell command for me to publish from the repository to my server, and a longish manual process to publish to addons.mozilla.org. One day I'll get around to that (or just find a co-maintainer :)).

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Captcha
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Syndicate content