私のアプリケーションでは、別の隠されたBrowserWindowを使用して新しい通知を表示します。 通知には2つのアイコンがあります。私は左の電子アイコンを編集することはできませんが、右のアイコンはちょうどうまく編集することができます。左に電子通知アイコンを変更できません
どのように私は左のアイコンを変更できますか?
私は、BrowserWindowのアイコンを変更し、電子パッケージャを通して電子のアイコンを変更しようとしました。 通知を生成したページのファビコンアイコンも変更しましたが、役に立たなくなりました。
通知に2つのアイコンが表示されていても、それに関する他のドキュメントは見つかりません。私の知る限り、それはネイティブのHTML5通知でなければなりません。
プラットフォーム:のMac OS Xエルキャピタン
電子版:レンダラJavaScriptで使用 1.1.1
コード:メインで使用
const electron = require('electron');
const ipc = electron.ipcRenderer;
var Notification = window.Notification || window.mozNotification || window.webkitNotification;
require('electron').ipcRenderer.on('showNotification', (event, message) => {
Notification.requestPermission();
var notification = new Notification("New Notification found");
});
require('electron').ipcRenderer.on('showNotificationAmount', (event, message) => {
Notification.requestPermission();
var notification = new Notification("New Notifications found!", {icon: "http://orig07.deviantart.net/d754/f/2011/132/e/4/google_chrome_icon_yellow_by_cameronsagey-d3g75gy.png", body: message + " new notifications available for you!"});
});
コード。 js:
//Make hidden window, used for notifications
hiddenNotificationBalloonWindow = new window({
show: false,
transparent: true,
icon: nativeImage.createFromPath(__dirname + '/images/logowindowicon.png')
});
hiddenNotificationBalloonWindow.setRepresentedFilename(__dirname + '/images/logowindowicon.png');
hiddenNotificationBalloonWindow.setDocumentEdited(true);
hiddenNotificationBalloonWindow.loadURL("file://" + __dirname + "/windows/hiddenHTML5NotifyBalloonActivator.html");
事前にお世話になりました!