From e23db1771db313126a4ceadce5c81253c41d2e55 Mon Sep 17 00:00:00 2001 From: FelisCatus Date: Wed, 26 Jul 2017 12:45:46 -0400 Subject: [PATCH] Fall back to link if openOptions fails in popup. --- omega-web/src/popup/index.html | 2 +- omega-web/src/popup/js/index.js | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/omega-web/src/popup/index.html b/omega-web/src/popup/index.html index 9182af8..b0826d3 100644 --- a/omega-web/src/popup/index.html +++ b/omega-web/src/popup/index.html @@ -44,7 +44,7 @@
  • - + diff --git a/omega-web/src/popup/js/index.js b/omega-web/src/popup/js/index.js index acc335b..4ec1154 100644 --- a/omega-web/src/popup/js/index.js +++ b/omega-web/src/popup/js/index.js @@ -16,10 +16,14 @@ window.close(); } - function showOptions() { - $script.ready('om-target', function() { - OmegaTargetPopup.openOptions(null, closePopup); - }); + function showOptions(e) { + if (typeof OmegaTargetPopup !== 'undefined') { + try { + OmegaTargetPopup.openOptions(null, closePopup); + e.preventDefault(); + } catch (_) { + } + } } function applyProfile(profileName) {