是否有用于跨浏览器桌面通知的 JavaScript 库?

发布于 2024-09-30 22:23:02 字数 2738 浏览 0 评论 0原文

我知道 W3C 刚刚发布了 Web 通知的草稿版本来通知用户。因此,没有浏览器在其当前或最新版本的浏览器中实现此方法。

Web 通知概述

在我搜索了大量网页以查找大多数浏览器中所有可能的桌面通知之后。我发现任何 2 个主要浏览器都应该支持此功能。

1.Google Chrome 和基于 Webkit 的浏览器

Windows 通知
(来源:google.com

 Mac 的通知
(来源:google.com

 Linux的通知
(来源:google.com

我们可以使用本机桌面通知功能来显示消息,如下图所示。

更多信息:Chromium 项目 - 桌面通知

2. Internet Explorer

对于 IE 5.5+,我们可以像 Google Chrome 一样使用 createPopup 函数来通知使用,但它比 Google Chrome 灵活得多。

创建弹出窗口

更多信息:MSDN 上的 CreatePopup 方法

此外,如果我们将网站固定到 Windows 7 任务栏,我们也可以使用覆盖图标来通知用户。

叠加图标
(来源:microsoft.com

更多信息: IE9、站点特定浏览器以及将您自己的跳转列表项添加到固定选项卡

< strong>其他浏览器

我认为我们可以使用 Pines Notify jQuery 插件来创建浏览器内通知。

Pines Notify

或者您有任何桌面通知库或建议我吗?

谢谢,

PS。如果没有好的库,我会自己创建一个。

更新一

从IE8开始,它不允许我们在当前浏览器之外显示弹出窗口。例如,当 IE 最小化时,所有弹出窗口都不会显示。因此,Google Chrome 是唯一一款具有完整 Web 通知 API 的浏览器(FF 4 也具有未记录的 Web 通知 API,但目前无法使用)。

I know W3C just publish their draft version of Web Notification to notify user. So, there is no browser that implement this method in their current or latest build browser.

Web Notifications Overview

After I search a lot of webs for finding all possible desktop notification in most browser.I found any 2 major browser that should support this.

1.Google Chrome and Webkit-based browser

Notification of Windows
(source: google.com)

Notification of Mac
(source: google.com)

Notification of Linux
(source: google.com)

We can use native Desktop notification function to show message like the following picture.

More infomation: The Chromium Projects - Desktop Notifications

2.Internet Explorer

For IE 5.5+, we can use createPopup function to notify use like in Google Chrome but it's much flexible more that Google Chrome.

Create Popup

More information: CreatePopup Method on MSDN

Moreover, if we pin website to Windows 7 taskbar, we can use overlay icon to notify user too.

Overlay Icon
(source: microsoft.com)

More information: IE9, Site Specific Browsers, and adding your own Jump List Items to Pinned Tabs

Other browser

I think we can use Pines Notify jQuery plugin to create in-browser notification.

Pines Notify

Or do you have any desktop notification library or idea for suggesting me?

Thanks,

PS. If it does not have fine library, I will create it with myself.

Update I

Since IE8, it does not allow us to display popup outside current browser. For example, when IE is minimized, all popups are not displayed. So, Google Chrome is only one browser that has fully web notification API (FF 4 also has non-documented web notification API but it not work for now).

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

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

发布评论

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

评论(5

恋竹姑娘 2024-10-07 22:23:02

我不知道跨浏览器库;但桌面通知也将出现在 Mozilla Firefox 4.0 之后。它们已经在主干中实现: https://bugzilla.mozilla.org/show_bug.cgi ?id=573588

虽然显然这个新功能不会包含在 FF 4.0 中: https://bugzilla.mozilla.org/show_bug.cgi?id=594543

但从长远来看,与 webkit 相关但不同的 api 将可用。

然而,不确定歌剧。

I don't know of a cross-browser lib; but desktop-notifications are coming to Mozilla Firefox post 4.0 as well. They're implemented in trunk already: https://bugzilla.mozilla.org/show_bug.cgi?id=573588

Though apparently this new feature won't get included in FF 4.0: https://bugzilla.mozilla.org/show_bug.cgi?id=594543

But in the long term, an api related to but different from the webkit will be available.

Not sure about opera, however.

沫离伤花 2024-10-07 22:23:02

我怀疑是否存在任何跨浏览器桌面通知 javascript 库,因为这些通知是供应商特定的实现,由 Web 浏览器本身而不是 W3C 或 WHATWG 实现。

CreatePopup 看起来像是为企业 Web 应用程序设计的,因为它从未受到重视,而且 Google 希望 Web 应用程序取代桌面应用程序。跳转列表只是向 IE9 提供 Windows 7 功能的一种方式,但这并不是推动云计算的举措。

I doubt that there are any cross-browser desktop notification javascript libraries, because those notifications are vendor specific implementations, made by the web browsers themselves, and not the W3C or WHATWG.

CreatePopup looks like it was made for enterprise web applications as it never took prominence, and Google wants web applications to replace desktop applications. Jumplists are just a way to provide Windows 7 functionality into IE9, but it's not a move to push to cloud computing.

生生漫 2024-10-07 22:23:02

我知道这已经过时了,但是 Push.js 允许跨浏览器桌面通知。

另外,现在是 2020 年,您可以使用原生通知 API 在大多数浏览器中。

请务必检查浏览器兼容性部分。

I know this is old but Push.js allows for cross-browser desktop notification.

Also, this is 2020, you can use the native Notification API in most browsers.

Make sure you check the Browser compatibility section.

攒一口袋星星 2024-10-07 22:23:02

dojo 工具包 http://www.dojotoolkit.org 在其 dojox 包中包含一个名为“Toaster”的控件,但是这是浏览器窗口内的通知,不遵循网络通知规范。也许它也是您的网络应用程序的解决方案。

The dojo toolkit http://www.dojotoolkit.org contains a control called "Toaster" in its dojox package, but this is a notification inside the browser window and does not follow the web notifications specification. Maybe it is also a solution for your webapp.

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