Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^5: RemoteObject.pm fails in open firefox8.0

by Corion (Patriarch)
on Oct 28, 2011 at 08:39 UTC ( [id://934339]=note: print w/replies, xml ) Need Help??


in reply to Re^4: RemoteObject.pm fails in open firefox8.0
in thread RemoteObject.pm fails in open firefox8.0

Your suggestion is duly noted but unless there is a convenient way to test with Firefox 8, I recommend you don't use it.

My advice is to run your mission critical programs with Firefox 7 and disable automatic upgrades of major versions.

  • Comment on Re^5: RemoteObject.pm fails in open firefox8.0

Replies are listed 'Best First'.
Re^6: RemoteObject.pm fails in open firefox8.0
by seven_shen (Acolyte) on Oct 28, 2011 at 09:40 UTC

    I can not bypass firefox8 now since I need to test the forward compatibility cases with my firefox add-on, And this usually begins with firefox beta releases(My add-on is ready now):(

    Anyway I am looking forward to a solution to this problem and waiting for your convenience , thanks a lot!

      I got some findings, here is the code:

      sub js_call_to_perl_struct { my ($self,$js,$context) = @_; $context ||= ''; $self->{stats}->{roundtrip}++; my $repl = $self->repl; if (! $repl) { # Likely during global destruction return }; my $queue = join '', map( { /;$/? $_ : "$_;" } map { s/\s*$//; $_ } @{ + $self->queue }); @{ $self->queue } = (); #warn "<<$js>>"; my @js; if ($queue) { push @js, $self->repl_API('q', $queue); }; push @js, $self->repl_API('ejs', $js, $context ); $js = join ";", @js; if (defined wantarray) { #warn $js; # When going async, we would want to turn this into a callback my $res = $self->execute_command($js); $res =~ s/^(?:\.+\>\s+)+//g; while ($res !~ /\S/) { # Gobble up continuation prompts warn "No result yet from repl"; $res = $self->execute_command(";"); # no-op $res =~ s/^(?:\.+\>\s+)+//g; }; my $d = $self->to_perl($res); if ($d->{status} eq 'ok') { return $d->{result} } else { croak ((ref $self).": $d->{name}: $d->{message}"); }; } else { #warn "Executing $js"; # When going async, we would want to turn this into a callback # This produces additional, bogus prompts... $self->execute_command($js); () }; };

      Where in the code :

      my $res = $self->execute_command($js);
      $js is:

      repl.ejs(" var f=function() {\n var wm = Components.classes[\"@mozilla.org/appshell/window-mediator;1\ +"]\n.getService(Components.interfaces.nsIWindowMediator);\n var win = wm.getMostRecentWindow('navigator:browser');\n if (! win) {\n// No browser windows are open, so open a new one.\n + win = window.open('about:blank');\n };\n return win.getBrowser()\n }\n;\n; f","" );
      In firefox7.0, after command execution, the return value $res is:

      "{"status":"ok", "result":{"result":1,"type":"function"} }"

      But in firefox 8,it returns something different: "8.0!"?!? Thats why it fails always. Any solutions?

        This looks like the UTF8 detection string that MozRepl::RemoteObject uses to test the connection for UTF-8 cleanlyness. I don't see why this string should get sent from MozRepl / Firefox again after MozRepl::RemoteObject was initialized.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://934339]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-19 19:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found