[chrome-gnome-shell] extension: open Shell extensions website on icon click.



commit 45f9a9fab135669d6cf20d8022d91710618cced3
Author: Yuri Konotopov <ykonotopov gnome org>
Date:   Sun Mar 26 11:12:46 2017 +0400

    extension: open Shell extensions website on icon click.
    
    Fixes: https://github.com/nE0sIghT/chrome-gnome-shell-mirror/issues/32

 extension/_locales/en/messages.json |    4 ++++
 extension/extension.js              |    7 +++++++
 extension/icons/GnomeLogo-32.png    |  Bin 0 -> 871 bytes
 extension/manifest.json             |    8 ++++++++
 4 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/extension/_locales/en/messages.json b/extension/_locales/en/messages.json
index 247ad09..449fc40 100644
--- a/extension/_locales/en/messages.json
+++ b/extension/_locales/en/messages.json
@@ -51,6 +51,10 @@
                "message": "No host response",
                "description": "Means 'Web extension does not received answer from native messaging host 
application.'"
        },
+       "open_website": {
+               "message": "Open GNOME Shell extensions website",
+               "description": "Tooltip for browser extensions icon."
+       },
        "platform_not_supported": {
                "message": "Native host connector is not supported for your platform."
        },
diff --git a/extension/extension.js b/extension/extension.js
index 83891a8..89829ca 100644
--- a/extension/extension.js
+++ b/extension/extension.js
@@ -67,6 +67,13 @@ chrome.runtime.onMessageExternal.addListener(function (request, sender, sendResp
        }
 });
 
+chrome.browserAction.onClicked.addListener(function () {
+       chrome.tabs.create({
+               url: EXTENSIONS_WEBSITE,
+               active: true
+       });
+});
+
 var disabledExtensionTimeout = null;
 var lastPortMessage = {message: null, date: 0};
 var port = chrome.runtime.connectNative(NATIVE_HOST);
diff --git a/extension/icons/GnomeLogo-32.png b/extension/icons/GnomeLogo-32.png
new file mode 100644
index 0000000..f5d42b6
Binary files /dev/null and b/extension/icons/GnomeLogo-32.png differ
diff --git a/extension/manifest.json b/extension/manifest.json
index 539c3bd..194324b 100644
--- a/extension/manifest.json
+++ b/extension/manifest.json
@@ -22,6 +22,14 @@
     "persistent": false
   },
 
+  "browser_action": {
+    "default_icon": {
+      "16": "icons/GnomeLogo-16.png",
+      "32": "icons/GnomeLogo-32.png"
+    },
+    "default_title": "__MSG_open_website__"
+  },
+
   "content_scripts": [
     {
       "matches": ["https://extensions.gnome.org/*";],


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