A
A
Alexey Zhigalov2018-05-25 07:50:38
Angular
Alexey Zhigalov, 2018-05-25 07:50:38

How to subscribe to http request in Angular2?

The component has an Iframe that makes an http request. In DevTools the request is visible.
Is it possible to subscribe to this request and receive a response from it, because the requester is not Angular itself, but an Iframe?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
ApeCoder, 2018-05-25
@alextanver

Access to iframe content is possible only from the same domain
As far as I know, all requests can only be intercepted using service workers, which are supported only in the latest versions of browsers and, moreover, must be installed.
If you have control over the content of the iframe, there might be a way to have the service worker intercept the requests and share them with the page that the iframe is on.
If this iframe is outside your domain, then the browser will not allow you to do this with it (unless it provides such functionality itself using the message sending interface )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question