在popup / webview中打开第三方url的最佳方法是使用反应js来跟踪相同的url

伙计们,需要围绕Reactjs提出一些想法和想法。 议程是在popup窗口或iframe中启动URL,并在popup窗口中向前移动时跟踪URL。 我已经实现了React Poput,但无法跟踪窗口URL。

popup中的url应该是第三方应用程序。

码:

<Popout url='/hiddenFormSubmit' ref={popoutRef => this.popoutRef = popoutRef} containerId='hiddenContainer' options={{height:'650px'}} title='Window title' onClosing={this.popoutClosed}> </Popout> 

function:

 constructor(props){ super(props); this.state = { isPoppedOut: false }; popout() { console.log(" Popout URL::"); this.setState({isPoppedOut: true }); } popoutClosed() { this.setState({isPoppedOut: false}); } 

我的隐藏表单组件在popup窗口中打开

 import React, { Component } from 'react'; import classnames from 'classnames'; export default class Perfios extends Component { static propTypes = {} static defaultProps = {} state = {} constructor(props){ super(props); } componentDidMount(){ this.myform.submit(); } render() { const { className, ...props } = this.props; return( <form ref={myform => this.myform = myform} method="POST" action="https://xyz.in/abc/url-third-party"> <input ref="inputField" name="id" type="hidden" value="11" /> <input name="adminId" type="hidden" value="123" /> <input name="surname" type="hidden" value="xyz" /> <button className="hidden" type="submit">SUBMIT</button> </form> ); } } 

在上面的代码中,表单正在提交组件挂载和redirect到第三方url。

find演示 。 如何跟踪父容器中popup窗口的URL? 任何线索将不胜感激。