能否在用户访问的每个网页上动态放置一段代码
因此,我们有一个程序,用户可以通过从他们访问的网页复制文本(按 alt+tab 键)到程序,然后将其粘贴为输入来使用。如果用户能够直接在网站上进行操作,将会更加方便。
我们正在考虑一个小型且可扩展的面板,跟踪他们访问的每个站点。这可能吗?自动粘贴的代码片段,或者调用的 JavaScript 命令将动态粘贴代码(Scratchpad 在这里有任何帮助,至少在 FireFox 中)。
我们从未制作过 FF 附加组件,但看起来如果动态面板的想法落空,附加组件将是下一个最好的选择。
基本上,理想情况下,用户应该能够复制文本,输入组合键或单击按钮,查看界面并粘贴文本。这些方法中的任何一个都有效吗?
So we have a program that the user can use by copying text from a webpage they visit, alt+tabbing to the program, then pasting it as input. It would be more convenient for users to be able to do it directly in the site.
We were thinking of a panel that would be small and expandable, following them to each site they visit. Is this possible? Either a snippet of code that is auto pasted, or a JavaScript command called that would dynamically paste the code (is Scratchpad any help here, at least in FireFox).
We've never made a FF add-on, but it seems like if the dynamic panel idea falls through, an add-on would be the next best thing.
Basically, users should ideally be able to copy text, either enter a key combo or click a button, see the interface and paste in the text. Would either of these methods work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
浏览器插件或用户脚本当然可以做到这一点。
您还可以编写用户脚本并使用用户脚本编译器(例如这个)来将其转换为“真正的”插件。
或者,您的应用程序可以充当 HTTP 代理并动态注入它,但我猜这可能比其他两种方法更复杂。
A browser add-on or a userscript could certainly do this.
You can also write a userscript and use a user script compiler (such as this one) to convert it to a "true" Addon.
Alternatively your application could act as a HTTP proxy and inject it dynamically, but I'd guess that this would probably be more complicated than the other two approaches.
这个网站 Polyvore 曾经做过类似的事情,尽管在 2 分钟内我四处搜寻找不到它,但我已经使用过它,并且我认为 Google 和 Digg 使用该技术已经有一段时间了。据我回忆,它涉及 iframe 和浏览器中的书签。
基本上,您可以下载一小段代码,将其放在书签栏中,这将允许您导航到时尚网站,单击书签,复制图片并将其插入回 Polyvore。
This site Polyvore used to do something similar, although in the 2 mins hunting around I could not find it, but I have used it and I think the technique was used by Google and Digg for a while. From what I recal it involved iframes and a bookmark in your browser.
Basically you could download a small piece of code that would sit in your bookmarks bar and this would allow you to navigate to a fashion website click on the bookmark copy a picture and insert it back into Polyvore.