bard / mozrepl

Remotely control Firefox and other Mozilla apps with JavaScript
https://github.com/bard/mozrepl/wiki/
510 stars 64 forks source link

MozRepl add on does not work with FF55 #68

Closed rappazf closed 7 years ago

rappazf commented 7 years ago

Tested with a perl script using the module WWW::Mechanize::Firefox. The script which works with FF54 does not work with FF55.

balta2ar commented 7 years ago

Same here. It's surprising, though, that it's not working, because according to their notice (https://support.mozilla.org/en-US/kb/firefox-add-technology-modernizing), things should break on FF57 (November 2017). @bard Any ideas?

melroy89 commented 7 years ago

Same!

I can't use document.hasFocus(), nor window.location.href nor document.readyState. These requests won't return anything anymore :(.

While my application did work with FF54. I think this is a high prio item.

bard commented 7 years ago

Sorry to be the bringer of bad news, but I haven't worked on MozRepl for a long time (as you can see from the home page, the project is officially orphaned), and any possible fix would be short-lived anyway, since Mozilla is retiring XPCOM support (which MozRepl depends on) in November 2017.

melroy89 commented 7 years ago

Ow no!! I just created a great application which costs me more than 90 hours of work, which now uses MozRepl to interact with Firefox. 😒

EDIT: Maybe we should look at how to use devtools.debugger.remote-enabled via telnet or any connection?

Or maybe we should look at Scratchpad, how did they do this? http://www.seleniumhq.org/

I think the best way to go forward is using Selenium in combination with GeckoDriver (for Firefox). Or use GeckoDriver directly. Selenium can be used in different programming languages, incl. Java, Python, Javascript, Ruby, C#. Python example:

import os
from selenium import webdriver
os.environ['PATH'] += os.pathsep + "/location/to/geckodriver/folder"

browser = webdriver.Firefox()
browser.get('http://seleniumhq.org/')
# Directly execute Javascript as you used to via MozRepl
blah = driver.execute_script('return document.getElementsByTagName("body")[0]')
print (blah)
# Using selenium webdriver find_element_by_id
input_field = driver.find_element_by_id('email')
# Use arguments (input_field) via execute_script again
browser.execute_script('arguments[0].setAttribute("style", "color: yellow")', input_field)

Selenium can be used cross-platform, and supports Chrome (ChromeDriver), Firefox (GeckoDriver), Safari (WebDriver) and Edge browsers (WebDriver).