ulixee / hero

The web browser built for scraping
MIT License
647 stars 32 forks source link

exportUserProfile fails when userProfile is loaded via userProfile option #240

Open Baker68 opened 9 months ago

Baker68 commented 9 months ago

Using the same project structure specified here, when the userProfile option is used, the exportUserProfile fails with error

TypeError: window.exportDomStorage is not a function

In order to reproduce this issue you should export the user profile then load it via userProfile option then try to export it again (after some surfing).

blakebyrnes commented 9 months ago

We have several tests and users using this feature and having it operate correctly. Can you give me more details on the exact flow that's failing for you? Are you manually navigating around chrome? Are you disabling javascript?

Baker68 commented 9 months ago

@blakebyrnes ;

No, I do not manually navigate around chrome ; No, I did not disabled javascript ;

I think that this issue is also related to the fact that I use a remote client instead of using the all-in-one provided by the '@ulixee/hero-playground`;

I did not encountered the same problem using the @ulixee/hero-playground package.

blakebyrnes commented 9 months ago

Does this happen for you on every url? It seems unlikely to be related to the transport, but could very easily be the state of the page when you're exporting. Perhaps it's not fully loaded when you're making this call and we need to add some kind of wait inside the api?

Baker68 commented 9 months ago

I have been doing some tests and it does seem to be related to the page state, but some times it even fails after waiting for AllContentLoaded. It fails even more often when I open a new tab (via waitForNewTab) and try to save the profile from there before closing the Hero session.

I will keep you posted.