Steveorevo / node-red-contrib-nbrowser

Provides a virtual web browser (a.k.a. "headless browser") appearing as a node.
34 stars 13 forks source link

Closing the instance #19

Closed KeiyaD closed 5 years ago

KeiyaD commented 5 years ago

I noticed that when executing a "getHTML" throws a timeout the instance does not close. and If I have a periodic execution of nbrowser, then the instances keep stacking up. Is there a option to close the instance if there is an error, timeout, warning or even closing by input?

Steveorevo commented 5 years ago

Make sure the "Close instance after methods?" is checked. Somewhere along the flow there should be a reference to the instance with the "Close instance after methods?" checked to close it.

KeiyaD commented 5 years ago

I have it checked. This is the configuration.

image

Any more ideas on what I can do? In case of an error, search the process and kill it?

It would also be good if there was a possibility to have a GOTO statement in the flow to keep the nbrowser in a loop instead of calling a new instance every time.

I wish this node would have some additional functionalities :)

Steveorevo commented 5 years ago

The instance is kept in the msg.nbrowser variable in the flow. After the timeout, does the flow continue to another node? If so, simply placing another nbrowser with the same msg.nbrowser will recycle/use that instance. It should be possible to close the instance.

If the issue persists; could you post a simplified flow that shows the issue for me to reproduce?

KeiyaD commented 5 years ago

The instance is kept in the msg.nbrowser variable in the flow I did not know that. That opens some new possibilities for me! I have to check that out! I'll try it out and report back! Thanks!

KeiyaD commented 5 years ago

The instance is kept in the msg.nbrowser variable in the flow. After the timeout, does the flow continue to another node? If so, simply placing another nbrowser with the same msg.nbrowser will recycle/use that instance. It should be possible to close the instance.

If the issue persists; could you post a simplified flow that shows the issue for me to reproduce?

I looped the browser and it works like a charm! image