浏览代码

Fall back to link if openOptions fails in popup.

FelisCatus 8 年之前
父节点
当前提交
e23db1771d
共有 2 个文件被更改,包括 9 次插入5 次删除
  1. 1 1
      omega-web/src/popup/index.html
  2. 8 4
      omega-web/src/popup/js/index.js

+ 1 - 1
omega-web/src/popup/index.html

@@ -44,7 +44,7 @@
     </li>
     <li class="om-divider"></li>
     <li class="om-nav-item">
-      <a href="#" id="js-option" role="button">
+      <a href="../options.html" target="_blank" id="js-option" role="button">
         <span class="glyphicon glyphicon-wrench"></span>
         <span id="js-option-label"></span>
       </a>

+ 8 - 4
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) {