gpt4 book ai didi

javascript - 以编程方式或通过用户输入从 iframe 捕获 URL

转载 作者:行者123 更新时间:2023-11-30 14:33:04 25 4
gpt4 key购买 nike

我正在建立一个网站,该网站将使用 iframe 作为围绕第 3 方网站的包含网站。我希望用户能够浏览第 3 方网站 (iframe),然后将 URL 提交到包含的网站,然后由我存储。

因此,我想提供:

  • 一种以编程方式访问 iframe 的当前 URL 并将其提交到包含站点的方法
  • 一种显示 iframe 当前 URL 的方法,用户可以将其复制或粘贴到包含的网站
  • 另一种方法

最佳答案

a way to programatically access the current URL of the iframe

你不能。这将涉及监视用户在另一个网站上所做的事情。浏览器不会让你这样做。

a way to display the current URL of the iframe

这将需要您以编程方式访问 iframe 的当前 URL。见上文。

another method

写一个浏览器扩展而不是尝试做一个网站。

关于javascript - 以编程方式或通过用户输入从 iframe 捕获 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50877005/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com