laurentj / slimerjs

A scriptable browser like PhantomJS, based on Firefox
http://slimerjs.org
Other
3k stars 258 forks source link

SlimerJS not compatible with Firefox 62 #707

Open kaosko opened 6 years ago

kaosko commented 6 years ago

versions

SlimerJS: 1.0.0, 1.1.0-pre
Firefox: 62 (59 works ok, up to 61 with a patch for #694)
Operating system:
Ubuntu 16.04.2 LTS

Steps to reproduce the issue

Try to take a screenshot of any webpage with slimer.js

Actual results:

Error during the script execution [Exception] TypeError: ioService.newChannel is not a function filename:resource://slimerjs/slUtils.jsm line:180

Stack trace: 0:readChromeFile@resource://slimerjs/slUtils.jsm:180:19 launchMainScript@resource://slimerjs/slLauncher.jsm:109:23 startup@chrome://slimerjs/content/slimerjs.js:20:9 onload@chrome://slimerjs/content/slimerjs.xul:1:1

Expected results:

Able to take a screenshot and operate normally.

Besides #694 that affects compatibility with FF 60, 61, FF 62 has apparently removed obsolete (since FF 48) functions newChannel(...) is nsIIOService (https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIIOService) used in slUtils.jsm.

kaosko commented 6 years ago

Not quite enough just switch to newChannel2 and provide null for the rest of the arguments (even though this post seems to suggest so: https://stackoverflow.com/questions/3772788/how-to-load-file-from-inside-firefox-plugin). Perhaps need to use newChannelFromURI2 instead since we have an URI argument. For my purposes though, I just disabled coffeescript in slConfiguration.jsm and that did the trick to make it working with FF 62.

marcwaz commented 6 years ago

please fix it +1

MarkR42 commented 6 years ago

Hi,

I found that passing nulls to newChannel2 isn't (quite) sufficient, instead, this seems to work with FF62:

--- a/ksn-feeder/slimerjs-mod/src/modules/slUtils.jsm +++ b/ksn-feeder/slimerjs-mod/src/modules/slUtils.jsm @@ -177,7 +177,9 @@ slUtils.readSyncStringFromFile = function readSyncStringFromFile (file) { }

slUtils.readChromeFile = function readChromeFile(url) {

Which is copied from some code I found in Firefox test suite.

Mark

On Fri, 14 Sep 2018 at 18:48, Kalle Korhonen notifications@github.com wrote:

Seems like you can just switch to newChannel2 and provide null for the rest of the arguments ( https://stackoverflow.com/questions/3772788/how-to-load-file-from-inside-firefox-plugin ).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/laurentj/slimerjs/issues/707#issuecomment-421434744, or mute the thread https://github.com/notifications/unsubscribe-auth/ABmsUtAxtVT_MyzxUuITXiiHkpfw0JpIks5ua-wDgaJpZM4Wprmb .

marcwaz commented 6 years ago

@MarkR42 could you provide a Dockerfile sample ? For me it doesn't work with FF62.

MarkR42 commented 6 years ago

I can't provide a Dockerfile sample. For me it works with this change (plus change application.ini to allow Firefox 62)