[chrome-gnome-shell] opera: remove buttons from notifications.



commit a0136f368eec4af22834df9ccb5cd8ab1ef00cd6
Author: Yuri Konotopov <ykonotopov gmail com>
Date:   Mon Aug 8 15:11:53 2016 +0300

    opera: remove buttons from notifications.
    
    Buttons are not supported in Opera 39.

 extension/include/constants.js     |    2 ++
 extension/include/notifications.js |    5 +++++
 2 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/extension/include/constants.js b/extension/include/constants.js
index d18cbb8..42d71af 100644
--- a/extension/include/constants.js
+++ b/extension/include/constants.js
@@ -11,6 +11,8 @@
 GS_CHROME_ID                           = chrome.i18n.getMessage('@@extension_id');
 PLATFORMS_WHITELIST                    = ["linux", "openbsd"];
 
+IS_OPERA                               = navigator.userAgent.indexOf(' OPR/') >= 0;
+
 NOTIFICATION_UPDATE_AVAILABLE          = 'gs-chrome-update';
 NOTIFICATION_UPDATE_CHECK_FAILED       = 'gs-chrome-update-fail';
 ALARM_UPDATE_CHECK                     = 'gs-chrome-update-check';
diff --git a/extension/include/notifications.js b/extension/include/notifications.js
index 36a512e..9ad4e47 100644
--- a/extension/include/notifications.js
+++ b/extension/include/notifications.js
@@ -62,6 +62,11 @@ GSC.notifications = (function($) {
 
                function _create(name, options, callback)
                {
+                       if(IS_OPERA && options.buttons)
+                       {
+                               delete options.buttons;
+                       }
+
                        if (callback)
                        {
                                chrome.notifications.create(name, options, callback);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]