Skip to content
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

SlimerJS not compatible with Firefox 63 #708

Open
kaosko opened this issue Oct 28, 2018 · 11 comments
Open

SlimerJS not compatible with Firefox 63 #708

kaosko opened this issue Oct 28, 2018 · 11 comments

Comments

@kaosko
Copy link

kaosko commented Oct 28, 2018

versions

Steps to reproduce the issue

Try to set a viewportSize on a webpage with slimer.js:
page.viewportSize = { width : width, height : height };

Actual results:

JavaScript error: resource://gre/modules/ActorManagerChild.jsm, line 192: TypeError: singletons is null

Script Error:
Stack:
-> resource://slimerjs/slimer-sdk/webpage.js: 998 (in function set viewportSize)
-> file:///mnt/raid1/personal/slimerjs/src/custom_renderwebpage.js: 80 (in function renderUrl)

Expected results:

Able to set the viewportSize.

Firefox 63 removed XPCOMUtils.generateQI but you can just replace that with ChromeUtils.generateQI (ChromeUtils doesn't need to be imported). Once that's done, the remaining issue "singletons is null". Apparently ActorManagerParent seems to be loaded/initialized somehow, these issues seem related: https://bugzilla.mozilla.org/show_bug.cgi?id=1485649
https://bugzilla.mozilla.org/show_bug.cgi?id=1499896

@kaosko
Copy link
Author

kaosko commented Oct 29, 2018

I don't see how you could monkeypatch ActorManagerChild (see the second issue) because the error happens as soon as you try to import it Cu.import("resource://gre/modules/ActorManagerChild.jsm");

@MarkR42
Copy link
Contributor

MarkR42 commented Oct 29, 2018

I created a new branch, https://github.com/MarkR42/slimerjs/tree/firefox63

I think the
viewportSize works on this build; many unit tests still fail but at least basic functionality is working (load pages, screenshot etc). Most of the event-based tests are failing though

@MarkR42
Copy link
Contributor

MarkR42 commented Mar 25, 2019

As of Firefox 66.0, some more functionality has been removed from Firefox which makes the JS xpcom module work. This means that essentially, all of SlimerJS functionality is incompatible with 66.0 and will probably be forever, unless we can work out some way of making it all work without the deprecated / removed interfaces.

@mikeperalta1
Copy link

Any update on this issue, or suggestions for drop-in replacements for SlimerJs?

@MarkR42
Copy link
Contributor

MarkR42 commented Dec 7, 2019

No.

Firefox has done a fundamental redesign which makes SlimerJS impossible / difficult to continue. SlimerJS would need to hook into Firefox at a much lower level than it currently does, which would probably need a special build of Firefox. Although that is theoretically feasible, it would make it much more sensitive to future architectural changes.

PhantomJS also failed due to the difficulty of keeping up with Webkit changes (and the maintainer quit), PhantomJS is in C++ and those interfaces were changed often.

I think your best bet is to use Webdriver from Selenium, that's also cross-browser. If you can do what you want with Webdriver, great.

Otherwise, write a Firefox extension and load that, the API is totally different and intended for different purposes. Some things, such as getting data from the DOM or injecting scripts, are really different. Firefox web-extensions have many limitations e.g. they can't access native files or other low-level APIs, that's by design too.

@mikeperalta1
Copy link

Hrm okay thanks. I think maybe I'll start learning to adapt some of my code over to webdriver or headless chrome or something, eventually.

@kaosko
Copy link
Author

kaosko commented Dec 8, 2019

Slimer.js still works great for what it does, it's just that you can't use FF newer than 62 with it. If you are using Debian/Ubuntu, you can easily get Firefox 60 ESR from the PPA repos.

@mikeperalta1
Copy link

Thank you, yes. I currently have a fully functional SlimerJs project but I'm just bummed I may eventually have to migrate away from it. It was my first choice after PhantomJs died.

@kensoh
Copy link

kensoh commented Jan 5, 2020

Hi @MarkR42 PhantomJS creator recently got back into action and it looks like his initial focus is Linux, with macOS and Windows as second priorities - https://github.com/ariya/phantomjs/issues

@kensoh
Copy link

kensoh commented Jan 5, 2020

Also copying @laurentj for info -

@mwbelt
Copy link

mwbelt commented Jun 10, 2020

@kensoh , did you see any remarks from the PhantomJS creator that said he was back in action? I didn't find any comments from him in a cursory review of the issues, but I may have missed something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants