从概念上讲是否可以创建一个 javascript 书签来复制和粘贴 html 表单条目?

发布于 2024-10-03 05:57:00 字数 664 浏览 0 评论 0原文

我认为这就是他们在 此页面,但我不确定。

我正在寻找的是一个可以添加到浏览器工具栏的书签,例如此页面上的书签。这个假设的脚本的工作方式与 Windows 剪贴板非常相似,不同之处在于它只需单击一个按钮即可复制 Web 表单中的整组条目,然后将这些相同的条目粘贴回具有相同字段的第二个表单中,位于不同的位置。网站。

我能找到的最接近我想要的是 这个 Firefox 插件,看起来它是完美的,除了它依赖于浏览器,这不会破坏交易。但事实上它已经被废弃了,甚至在最新版本的 Firefox 中也不再工作了,所以它几乎没有用处。

我对 javascript 的了解不够,不知道这在理论上是否可行,因此提出了这个问题。

I think this is what they are talking about on this page, but I'm not sure.

What I am looking for is a bookmarklet I can add to the toolbar of my browser, like the ones on this page. This hypothetical script would work much like the Windows clipboard, except that it would copy an entire set of entries in a web form with the click of one button, and then paste those same entries back into a second form with identical fields, on a different website.

The closest I've been able to find to what I want is this Firefox addon, which looks like it would be perfect, except that it's browser dependent, which wouldn't be a dealbreaker. But in fact it's been abandoned and won't even work in the latest version of Firefox any more, so it's pretty much useless.

I don't know enough about javascript to know if this is even possible in theory, hence this question.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

眼泪也成诗 2024-10-10 05:57:00

将复制的内容粘贴到具有自己的表单字段的第二个已识别源的部分可能是不可能的。可以很容易地找到用于提取表单值的小书签。

http://ostermiller.org/bookmarklets/

我正在尝试类似的东西,通过书签会很好,但我解决了 Firefox 插件。如果您找到更好的解决方案,请分享。

此链接表示 Opera 还具有插入 grasmonkey 脚本的内置功能。 http://my.opera.com/thibi/blog/firefox-to-opera

The part of pasting what's copied to a second identified source with it's own form fields may not be possible. A bookmarklet for extracting the values of a form may be easily found.

http://ostermiller.org/bookmarklets/

I'm attempting something similar, via bookmarklet would be nice but I settled for the firefox addons. Please share if you've found a better solution.

This link says Opera also has a built in capability to insert greasmonkey scripts. http://my.opera.com/thibi/blog/firefox-to-opera

¢蛋碎的人ぎ生 2024-10-10 05:57:00

我认为这是不可能的 - 为此您需要跨域脚本。您可以将其放入真正的剪贴板(json 编码等)中,但出于安全原因,这在所有/大多数浏览器中都是不可能的。我可以想象的是,使用 json 编码的数据制作一个 javascript 弹出窗口,用户可以在阅读表单数据后复制该数据,并在“粘贴”时弹出一个 javascript 输入,要求您按 CTRL+V。

为什么不把它做成一个附加组件呢?

I don't think that it's possible - you would need cross-domain scripting for that. You could put it in the real clipoard (json-encoded or so), but that's not possible in all/most browsers for security reasons. What I could imagine is making a javascript-popup with the json-encoded data that the user could copy or so after reading the form data and a javascript input that pops up when "pasting" that asks you to press CTRL+V.

Why don't you make it an add-on?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文