将链接拖放到桌面上以创建快捷方式
今天我的客户问了我一件有趣的事情。
将浏览器中的链接拖放到桌面上以创建链接网页的快捷方式。
我们有一个网络应用程序,让用户能够直接连接他们的应用程序可能会非常好。
您知道如何做到这一点吗?
My client asked me a interesting thing today.
Drag and drop a link in the browser on the desktop to create a shortcut to the linked webpage.
We have a web-application and it could be very good to enable the user to directly connect their application.
Do you have any idea of how to do that ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这不是 Windows 中大多数浏览器的实际工作方式吗?我刚刚在 Firefox 和 IE 中尝试过,两者都给了我一个直接到桌面上的页面的快捷方式。或者我在你的问题中漏掉了一些东西?
Isn't this how it actually works with most browsers in Windows? I've just tried in Firefox and IE, and both gave me a shortcut direct to the page on the desktop. Or am I missing something in your question?
在 Windows 中运行良好。如果您谈论的是某种 javascript 链接或按钮,恐怕不是。
Works fine in Windows as-is. If you're talking about some sort of javascript link or button I"m afraid not.
将任何链接拖动到桌面应该可以,但您可以通过创建一个特殊链接(可能是每个屏幕)来扩展它,这将使用户返回到确切的应用程序状态。
显然,您必须将任何状态保留信息添加到链接 URL 中。您可能还需要更新 Web 应用程序才能根据该信息恢复状态。
Dragging any link to the desktop should work, but you could extend it by creating a special link (perhaps per screen) that will let the user return to the exact application state.
Obviously you would have to add any state-preserving info into the links URL. You might also have to update the web application to restore the state based on that info.
进一步的建议:将状态放在 URL 的锚点中,如下所示:
http://mycompany.com/myapplication#mystatevariable=xyz
这样,浏览器就不会重新加载整个应用程序。当然,您必须监视 URL 并在 Javascript 中处理锚点。
A further suggestion: put the state in the anchor of the URL, like so:
http://mycompany.com/myapplication#mystatevariable=xyz
That way, the browser doesn't reload the whole application. Of course, you'll have to monitor the URL and process the anchor in Javascript.