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

Problems with tabs_restart_browser #279

Closed
turban1988 opened this issue Apr 10, 2019 · 1 comment
Closed

Problems with tabs_restart_browser #279

turban1988 opened this issue Apr 10, 2019 · 1 comment

Comments

@turban1988
Copy link
Contributor

turban1988 commented Apr 10, 2019

Hi,
In one of my crawls the crawler crashed with the following exception: (the line numbers do not match this repo as I adjusted the platform to my needs. The relevant code is https://github.com/mozilla/OpenWPM/blob/e095344a1343cecd31be126941278efd0dae618c/automation/Commands/browser_commands.py#L99):

  File "/home/openwpm/new_try_ext_neu/OpenWPM/automation/BrowserManager.py", line 407, in BrowserManager
    browser_params, manager_params, extension_socket)
  File "/home/openwpm/new_try_ext_neu/OpenWPM/automation/Commands/command_executor.py", line 21, in execute_command
  File "/home/openwpm/new_try_ext_neu/OpenWPM/automation/Commands/browser_commands.py", line 153, in get_website
    tab_restart_browser(webdriver)
  File "/home/openwpm/new_try_ext_neu/OpenWPM/automation/Commands/browser_commands.py", line 137, in tab_restart_browser
    webdriver.execute_script("window.open('')")
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 543, in execute_script
    'args': converted_args})['value']
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 308, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
    raise exception_class(message, screen, stacktrace)
WebDriverException: Message: TypeError: window.open is not a function

I guess the visited website (I did not track the exact website down) overrode window.open() function. Thus, the platform cannot call the function and aborts the crawl.

Maybe the function should be backed up in some way (e.g., https://stackoverflow.com/questions/48006527/restore-native-window-method).

@englehardt
Copy link
Collaborator

This is likely the same issue as #280. I'd rather us not have to mess with page script level code to fix this. We should revisit the methods available to us through Selenium to control browser tabs.

Resolving as a duplicate of #280.

@vringar vringar changed the title Problems with tabs_restart_borwser Problems with tabs_restart_browser Nov 5, 2019
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

2 participants