Chrome扩展程序的系统托盘图标 [英] System tray icon for Chrome extension

查看:169
本文介绍了Chrome扩展程序的系统托盘图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的清单包含一个漂亮的图标,而我的background.js页面触发了该扩展的主要功能。



是否有一些简单的方法可以在通知中获得完全相同的功能托盘?换句话说,是否有任何方法可以在任务栏中放置一个图标(例如,Google环聊的环聊扩展程序),并在单击时触发单个事件。



这里是我在浏览器中使用的代码:

  chrome.browserAction.onClicked.addListener(function( 
{
mainFunction();
});

我想象一下,除了清单外,还有一个简单的补充,这将达到我想要的结果。 解决方案

Chrome扩展程序无法访问系统托盘, =https://stackoverflow.com/questions/20306548/how-to-use-system-indicator-in-the-manisfet-of-a-chrome-packaged-app/31476353#31476353>没有API 。

环聊特别地在Chromium源代码中列入白名单以获得一些特殊权限。


My manifest includes a nice icon and my background.js page triggers the extension's main functionality.

Is there some easy way to get the exact same functionality within the notification tray? In other words, is there any way to put an icon in the task bar (like google does with the hangouts extension), and trigger a single event when it is clicked.

Here is the code I use for the action button in the browser itself:

chrome.browserAction.onClicked.addListener(function(tab)
{
    mainFunction();
});

I'd imagine there is a simple addition to the manifest along with a simple line like the above, that would achieve my desired result.

解决方案

Chrome extensions don't have access to the system tray, and there is no API for that.

Hangouts is specifically whitelisted in the Chromium source code to get some special privileges.

这篇关于Chrome扩展程序的系统托盘图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆