Javascript Async

Andrea

Client
Регистрация
13.03.2016
Сообщения
1
Благодарностей
0
Баллы
1
Hi,
I'm making a Javascript Async request using a the Custom Javascript Code.

How can I get the response from the promise?

I am adding the result in window.myResponse but h ow can I wait the response before executing other code?

If I dont find a way to wait for the async operation to be completed when i access window.MyResponse will not be filled yet.

I've added a c# custom code after the Javascript Block but ActiveTab.WaitDownloading is not working, the tab is not busy.

I can see the request using GetTraffic but if I read the TrafficItem before the request has arrived I cant read the body.

Can someone help me to understand the proper pattern to wait for a request to complete?
thanks
 

BAZAg

Client
Регистрация
08.11.2015
Сообщения
1 781
Благодарностей
2 442
Баллы
113
Hi,
I'm making a Javascript Async request using a the Custom Javascript Code.

How can I get the response from the promise?

I am adding the result in window.myResponse but h ow can I wait the response before executing other code?

If I dont find a way to wait for the async operation to be completed when i access window.MyResponse will not be filled yet.

I've added a c# custom code after the Javascript Block but ActiveTab.WaitDownloading is not working, the tab is not busy.

I can see the request using GetTraffic but if I read the TrafficItem before the request has arrived I cant read the body.

Can someone help me to understand the proper pattern to wait for a request to complete?
thanks
Perhaps this will help - it will make the browser wait while the JS takes the tab with work. But it is not exactly.
C#:
instance.IgnoreAjaxRequests = false;
instance.IgnoreAdditionalRequests = false;
instance.IgnoreFrameRequests = false;
instance.IgnoreFlashRequests = false;
 
  • Спасибо
Реакции: Andrea

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)