New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repl gets cleared after entering content #37

Closed
nkkarthik opened this Issue Jan 31, 2013 · 8 comments

Comments

Projects
None yet
6 participants
@nkkarthik
Copy link

nkkarthik commented Jan 31, 2013

Please look at the below interaction.

  • I have repl
  • repl.enter shows as a function
  • I enter content
  • repl.enter... no more
  • repl... still prints that it has something
repl> repl
[object Object] - {onOutput: function() {...}, onQuit: function() {...}, _name: "repl", ...}
repl> repl.enter
function() {...}
repl> repl.enter(content)
[object Window] - {window: {...}, document: {...}, navigator: {...}, location: {...}, ...}
repl> repl.enter
repl> repl
[object Object] - {onOutput: function() {...}, onQuit: function() {...}, _name: "repl", ...}
repl> 

What could I be doing wrong here, let me know, please.
This happens only with some pages... but it consistently happens with those pages.

@nkkarthik

This comment has been minimized.

Copy link

nkkarthik commented Feb 6, 2013

I tested it again. It doesn't work with FF 17 or 18. I went back to 16.0.2 and it seems to work now.

@fmancinelli

This comment has been minimized.

Copy link

fmancinelli commented Apr 15, 2013

Got the same exact issue.

repl> repl.enter(content);
repl> repl.back();
!!! TypeError: repl.back is not a function

This is a pity because it makes moz.el unusable from Emacs if you want to load your JS buffer to the current HTML page via C-c C-l

Any idea about how to fix this?

@fmancinelli

This comment has been minimized.

Copy link

fmancinelli commented Apr 16, 2013

If this can help it only happens when you do a repl.enter(content) when a HTML page is loaded in a tab.
For example, if you do it when the add-ons tab is focused, everything works as expected.

This on Firefox 20.0.1

@nkkarthik

This comment has been minimized.

Copy link

nkkarthik commented Apr 17, 2013

Yeah, I too noticed that it works with add-ons tab. I am not sure why this happens and, sadly, don't have time to debug the issue (keeping aside whether I can debug it in the first place :) ). For now just sticking with Firefox v16.

@windompeak

This comment has been minimized.

Copy link

windompeak commented Apr 22, 2013

Yes, I can reproduce this bug as well for any FF v17+. A big show-stopper for my use cases.

@xatom

This comment has been minimized.

Copy link

xatom commented Apr 29, 2013

While I am having the same issue, there's a simple workaround since you don't need to enter the content object in order use its methods:

content.document.location.href = "http://maps.google.com";
// get the context of the visible tab and save it
var maps = content.document;

var searchInput = maps.getElementById("gbqfq");
content.alert(searchInput.value);
searchInput.value = "from: new york city, ny to: chicago, il";
maps.getElementById("gbqfb").click();

I apologize for the sloppy code.

@rpl rpl closed this in 3393973 Apr 29, 2013

@ricardo4621

This comment has been minimized.

Copy link

ricardo4621 commented Nov 17, 2013

I'm seeing this issue again in FF 25 with this patched version.

repl> repl.enter(content.document);
[object HTMLDocument] - {location: {...}, global-zeroclipboard-flash-bridge: function() {...}, jQuery203084890703625190040.053885937142066576: 2, jQuery203084890703625190040.3173927485539211: 55, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, ...}
repl> repl.home();
!!! TypeError: repl is undefined

However,
repl.enter(content);
repl.enter(document);

works as intended to enter content.document

@vapniks

This comment has been minimized.

Copy link

vapniks commented Aug 25, 2015

I get the same problem with firefox 40.0

repl> repl.enter(content.document)
repl> repl.look() 
!!! ReferenceError: repl is not defined

Details:

Even if I enter one at a time:

repl> repl.enter(content)
repl> repl.enter(document)
repl> repl.look()
!!! ReferenceError: repl is not defined

Details:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment