[extensions-web] extensions.js: do not show inline install message if API is exported.



commit 06fdd11a7be2fe29b49a1297bc281a51c28f96a0
Author: Yuri Konotopov <ykonotopov gnome org>
Date:   Wed Mar 8 21:22:23 2017 +0400

    extensions.js: do not show inline install message if API is exported.
    
    Let's assume that browser extension is installed and will handle errors.

 sweettooth/static/js/extensions.js |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/sweettooth/static/js/extensions.js b/sweettooth/static/js/extensions.js
index a51090e..04d9a21 100644
--- a/sweettooth/static/js/extensions.js
+++ b/sweettooth/static/js/extensions.js
@@ -44,15 +44,19 @@ define(['jquery', 'messages', 'dbus!_', 'extensionUtils', 'templates', 'paginato
                // is running with an old Shell version but a newer plugin, error out.
                if (dbusProxy.IsDummy)
                {
-                       // We don't have a proper DBus proxy
-                       if (IS_CHROME || IS_FIREFOX || IS_OPERA) // browser_extension.js should be included 
globally
+                       // We don't have a proper DBus proxy, however API may be exported.
+                       // If API is exported let's assume that browser extension is installed and will 
handle errors.
+                       if(!('SweetTooth' in window))
                        {
-                               // Help user to install browser extension for supported browsers
-                               messages.addInfo(templates.get('messages/browser_extension')());
-                       }
-                       else
-                       {
-                               messages.addError(templates.get('messages/dummy_proxy')());
+                               if (IS_CHROME || IS_FIREFOX || IS_OPERA) // browser_extension.js should be 
included globally
+                               {
+                                       // Help user to install browser extension for supported browsers
+                                       messages.addInfo(templates.get('messages/browser_extension')());
+                               }
+                               else
+                               {
+                                       messages.addError(templates.get('messages/dummy_proxy')());
+                               }
                        }
 
                        $.fn.addExtensionSwitch = function () {


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