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

In Firefox 77.0.1 (64-bit) tab is not exposing the console #7

Closed
emibap opened this issue Jun 4, 2020 · 7 comments
Closed

In Firefox 77.0.1 (64-bit) tab is not exposing the console #7

emibap opened this issue Jun 4, 2020 · 7 comments
Assignees

Comments

@emibap
Copy link

emibap commented Jun 4, 2020

Hey. Sadly, after updating to FF 77 the console access seems to be broken.

Here's the code to verify it:

const url = 'http://www.bing.com'
const timeout = 10

import Foxdriver from '@benmalka/foxdriver'

(async () => {
    console.log('FoxDriver Visiting URL: ' + url);
    const { browser, tab } = await Foxdriver.launch({
        url: url
    });

    if (!tab.hasOwnProperty('console')) {
        console.error('FoxDriver error: Tab object not exposing console.')
        process.exit([1])
    }

    try {
        await tab.console.startListeners();
    } catch(e) {
        console.error('FoxDriver error connecting to the browser console: ' + e.toString())
        process.exit([1])
    }

    // wait until page is loaded and a timeout to get the console log
    await new Promise((resolve) => setTimeout(resolve, timeout*1000))
    // Get logs and page errors
    let logs = null
    try {
        logs = await tab.console.getCachedMessages();
    } catch(e) {
        console.error('FoxDriver error getting console messages: ' + e.toString())
        process.exit([1])
    }

    console.log('FoxDriver logs:');
    console.log(logs)
    
    // close browser
    browser.close()
    console.log('FoxDriver autoclosing after ' + process.uptime() + ' seconds');

})()

I tested it on Mac OS Catalina and Windows 10.

@flotwig
Copy link

flotwig commented Jun 25, 2020

Having a similar issue - FF 77 64-bit on Linux, tab.memory is no longer available, where it was in earlier versions.

@flotwig
Copy link

flotwig commented Jun 25, 2020

This seems to be the culprit @emibap: saucelabs#17

flotwig added a commit to cypress-io/cypress that referenced this issue Jun 25, 2020
@benmalka benmalka self-assigned this Jun 28, 2020
@benmalka
Copy link
Owner

The issue is related to the new architecture change of the Tab object. There's a backward compatibility code that checks whether it is necessary to fetch the Tab's actors (using getTarget) or not (for firefox versions < 75 ). It will be fixed today

brian-mann pushed a commit to cypress-io/cypress that referenced this issue Jun 29, 2020
* chore(deps): [email protected]

BREAKING CHANGE: libgbm is a requirement

* update node, xcode, docker images

* lockfile

* chore(types): tsify lib/gui/windows and spec

* fix Electron extension loading

global extension loading was deprecated in 9, now has to be per-session

* make windows fns stubbable

* update electron_spec

* tsify issue_173_spec

* use upstream foxdriver to fix FF >= 75

see benmalka/foxdriver#7

* update test

* for now, install libgbm-dev at ci time

see cypress-io/cypress-docker-images#332

* fix open mode

* remove devtools-ext dir
@benmalka
Copy link
Owner

#8

@benmalka
Copy link
Owner

@emibap
Please discard this block. It will always fail

if (!tab.hasOwnProperty('console')) {
console.error('FoxDriver error: Tab object not exposing console.')
process.exit([1])
}

Tab object has no actual property of 'console' before it has been called.

@benmalka
Copy link
Owner

v0.4.1 has been published to npm. Closing issue

@flotwig
Copy link

flotwig commented Jun 30, 2020

Thanks @benmalka

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

3 participants