Skip to content
Advertisement

Javascript don’t want to use await

I have an async function like that:

JavaScript

When I call this method, I am calling it like that:

JavaScript

It works well in this way. But I don’t want to use the await keyword when calling this method. If I remove the await keyword, it waits forever in this line: await page.setRequestInterception(true); It should work on the background I don’t want to wait in that line.

How can I resolve this?

Advertisement

Answer

Use then

JavaScript

And:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement