node.jselectronnightmare

Nightmare page content not loading - Cannot assign to read only property 'onbeforeunload' of object '#<Window>'


I'm using nightmare.js to make a bot that should perform the following tasks:

  1. Go to facebook
  2. Login into facebook
  3. Go to marketplace
  4. Make a marketplace publication

Once I get into fb and successfully login, no content is loaded except from the bluebar:

error

Nightmare uses electron, which's Devtools throws following errors:

throwed error

Note this is a self answered question, please, do not remove the answer. You may downvote it if, with some reasonable argument, you don´t agree with it or have a better proposal.


Solution

  • Following this solution: https://github.com/segmentio/nightmare/issues/1082#issuecomment-312115976

    In your app folder, go to \node_modules\nightmare\lib\preload.js Lines 50 and 55: change

    writable: false,
    

    to

    writable: true,