- This store is running some apps + This store is running some apps and a variation of the Shopify theme (renamed to )
@@ -58,7 +58,7 @@diff --git a/css/popup.css b/css/popup.css index 80878c2..06ac222 100644 --- a/css/popup.css +++ b/css/popup.css @@ -22,8 +22,13 @@ body { .apps-table-container { max-height: 300px; - overflow: scroll; + overflow-y: auto; min-width: 400px; + width: 100%; +} + +.table-apps { + margin-bottom: 0; } .app-links > a { diff --git a/img/icons/bigcommerce.png b/img/icons/bigcommerce.png new file mode 100644 index 0000000..21e56cc Binary files /dev/null and b/img/icons/bigcommerce.png differ diff --git a/img/icon-disabled.png b/img/icons/detector-disabled.png similarity index 100% rename from img/icon-disabled.png rename to img/icons/detector-disabled.png diff --git a/img/icon.png b/img/icons/detector.png similarity index 100% rename from img/icon.png rename to img/icons/detector.png diff --git a/img/fera_icon-64px.png b/img/icons/fera.png similarity index 100% rename from img/fera_icon-64px.png rename to img/icons/fera.png diff --git a/img/icons/magento1.png b/img/icons/magento1.png new file mode 100644 index 0000000..b74c30f Binary files /dev/null and b/img/icons/magento1.png differ diff --git a/img/icons/magento2.png b/img/icons/magento2.png new file mode 100644 index 0000000..f25dc3f Binary files /dev/null and b/img/icons/magento2.png differ diff --git a/img/icons/shopify.png b/img/icons/shopify.png new file mode 100644 index 0000000..83cae8b Binary files /dev/null and b/img/icons/shopify.png differ diff --git a/img/icons/wix.png b/img/icons/wix.png new file mode 100644 index 0000000..f99eb48 Binary files /dev/null and b/img/icons/wix.png differ diff --git a/img/icons/woocommerce.png b/img/icons/woocommerce.png new file mode 100644 index 0000000..1fa0ca3 Binary files /dev/null and b/img/icons/woocommerce.png differ diff --git a/js/background.js b/js/background.js index 9dff99b..013cf06 100644 --- a/js/background.js +++ b/js/background.js @@ -10,7 +10,14 @@ SAD.Background = function(opts) { chrome.runtime.onMessage.addListener(function(msgObj) { if (msgObj.action == 'getApps') { - chrome.runtime.sendMessage({ action: "setApps", apps: self.apps, detectableApps: SHOPIFY_APPS, detectableThemes: SHOPIFY_THEMES, theme: self.theme }); + chrome.runtime.sendMessage({ + action: "setApps", + apps: self.apps, + detectableApps: SHOPIFY_APPS, + detectableThemes: SHOPIFY_THEMES, + theme: self.theme, + platform: self.platform + }); return true; } else if (msgObj.action =='setPageScripts') { self.detectScripts(msgObj.pageScripts, msgObj.pageUrl, msgObj.theme); @@ -28,7 +35,7 @@ SAD.Background = function(opts) { self.setLoading = function() { chrome.browserAction.disable(); - chrome.browserAction.setIcon({ path: 'img/icon.png' }); + chrome.browserAction.setIcon({ path: 'img/icons/detector.png' }); chrome.browserAction.setBadgeText({ text: '..' }); @@ -38,14 +45,15 @@ SAD.Background = function(opts) { chrome.browserAction.setBadgeText({ text: '' }); - chrome.browserAction.setIcon({ path: 'img/icon-disabled.png' }); + chrome.browserAction.setIcon({ path: 'img/icons/detector-disabled.png' }); chrome.browserAction.disable(); }; self.detectScripts = function(scripts, pageUrl, windowTheme) { var detector = new SAD.Detector({ scripts: scripts, pageUrl: pageUrl, windowTheme: windowTheme }); + self.platform = detector.detectPlatform(); - if (detector.isShopifyStore()) { + if (self.platform) { self.apps = detector.detectApps(); self.theme = detector.detectTheme(); @@ -53,7 +61,7 @@ SAD.Background = function(opts) { text: self.apps.length.toString() }); chrome.browserAction.enable(); - chrome.browserAction.setIcon({ path: 'img/icon.png' }); + chrome.browserAction.setIcon({ path: 'img/icons/' + self.platform + '.png' }); return true; } else { self.disable(); diff --git a/js/detector.js b/js/detector.js index ad92e64..ee9b28b 100644 --- a/js/detector.js +++ b/js/detector.js @@ -31,14 +31,24 @@ SAD.Detector = function(opts) { return { name: self.windowTheme.name, custom_name: self.windowTheme.name, fully_custom: true}; }; - self.isShopifyStore = function() { + self.detectPlatform = function() { // Skip this site - it's core shopify - if (opts.pageUrl.match(/.*\.shopify\..*/i)) return false; + if (opts.pageUrl.match(/.*\.(shopify|magento|bigcommerce)\.[a-z]+/i)) return false; for (var i = 0; i < self.scripts.length; i++) { var script = self.scripts[i]; - if (!script.match(/.*\.shopify\..*/i)) { - return true; + if (script.match(/cdn[0-9]*\.bigcommerce\.[a-z]+/i)) { + return 'bigcommerce'; + } else if (script.match(/cdn[0-9]*\.shopify\.[a-z]+/i)) { + return 'shopify'; + } else if (script.match(/mage\/cookies\.js/i)) { + return 'magento1'; + } else if (script.match(/mage\/polyfill(\.min)?\.js/i)) { + return 'magento2'; + } else if (script.match(/woocommerce/i)) { + return 'woocommerce'; + } else if (script.match(/services\/wix-/i)) { + return 'wix'; } } return false; diff --git a/js/popup.js b/js/popup.js index e398760..943a23f 100644 --- a/js/popup.js +++ b/js/popup.js @@ -2,7 +2,8 @@ SAD.Popup = function(opts) { opts = opts || {}; var self = this; - var $themeSummary, $themeCustomNameContainer, $customName, $themeName, $fullyCustomTheme, $existingTheme, $fullyCustomThemeNameSection; + var $themeSummary, $themeCustomNameContainer, $customName, $themeName, + $fullyCustomTheme, $existingTheme, $fullyCustomThemeNameSection, $platformName; var init = function() { self.apps = []; @@ -13,7 +14,8 @@ SAD.Popup = function(opts) { self.detectableApps = msgObj.detectableApps; self.detectableThemes = msgObj.detectableThemes; self.theme = msgObj.theme; - self.displayApps(); + self.platform = msgObj.platform; + self.updateDisplay(); } else if (msgObj.action == 'setLoading') { $('#appsTable').css('opacity', 0.5); } @@ -22,7 +24,7 @@ SAD.Popup = function(opts) { chrome.runtime.sendMessage({ action: "getApps"}); }; - self.displayApps = function() { + self.updateDisplay = function() { var $table = $('#appsTable'); var $body = $table.find('tbody'); var $num = $('.num-detections'); @@ -41,6 +43,8 @@ SAD.Popup = function(opts) { $table.css('opacity', 1); $table.show(); } + + $platformName.text(self.platform); } // Private Methods // @@ -53,6 +57,7 @@ SAD.Popup = function(opts) { $fullyCustomTheme = $('.fully-custom-theme'); $existingTheme = $('.existing-theme'); $fullyCustomThemeNameSection = $('.theme-custom-name-section'); + $platformName = $('.platform-name'); }; var showThemeDetection = function() { diff --git a/manifest.json b/manifest.json index d83ae96..da3202c 100644 --- a/manifest.json +++ b/manifest.json @@ -1,16 +1,16 @@ { "manifest_version": 2, - "name": "Shopify App/Theme Detector by Fera.ai", - "description": "Detect which apps and what theme a Shopify store is using. Built and maintained by Fera.ai and the Shopify dev community.", - "version": "0.5.4", + "name": "Shopify App Detector by Fera.ai", + "description": "Detect which apps and what theme a Shopify store is using. Built and maintained by Fera.ai and the community.", + "version": "0.6.0", "author": "Fera.ai", "homepage_url": "https://www.github.com/feracommerce/shopify_app_detector", - "icons": { "16": "img/icon.png", - "48": "img/icon.png", - "128": "img/icon.png" }, + "icons": { "16": "img/icons/detector.png", + "48": "img/icons/detector.png", + "128": "img/icons/detector.png" }, "browser_action": { - "default_icon": "img/icon-disabled.png", + "default_icon": "img/icons/detector-disabled.png", "default_popup": "popup.html" }, "permissions": [ diff --git a/popup.html b/popup.html index afc17bc..feffded 100644 --- a/popup.html +++ b/popup.html @@ -19,14 +19,14 @@
- This store is running some apps + This store is running some apps and a variation of the Shopify theme (renamed to )
@@ -58,7 +58,7 @@