Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

:sparkles: Detech whether extension is already installed or not, if not, shoe install prompt toast

Liyas Thomas8b7fd238d07b
diff --git a/layouts/default.vue b/layouts/default.vue
index 4da707eec..4002a8875 100644
--- a/layouts/default.vue
+++ b/layouts/default.vue
@@ -470,27 +470,33 @@
</a>
</div>
<div>
- <button class="icon" disabled>
- <svg
- class="material-icons"
- xmlns="http://www.w3.org/2000/svg"
- width="24"
- height="24"
- viewBox="0 0 24 24"
- >
- <path
- d="M2.897 4.181c2.43-2.828 5.763-4.181 9.072-4.181 4.288 0 8.535 2.273 10.717 6.554-2.722.001-6.984 0-9.293 0-1.674.001-2.755-.037-3.926.579-1.376.724-2.415 2.067-2.777 3.644l-3.793-6.596zm5.11 7.819c0 2.2 1.789 3.99 3.988 3.99s3.988-1.79 3.988-3.99-1.789-3.991-3.988-3.991-3.988 1.791-3.988 3.991zm5.536 5.223c-2.238.666-4.858-.073-6.293-2.549-1.095-1.891-3.989-6.933-5.305-9.225-1.33 2.04-1.945 4.294-1.945 6.507 0 5.448 3.726 10.65 9.673 11.818l3.87-6.551zm2.158-9.214c1.864 1.734 2.271 4.542 1.007 6.719-.951 1.641-3.988 6.766-5.46 9.248 7.189.443 12.752-5.36 12.752-11.972 0-1.313-.22-2.66-.69-3.995h-7.609z"
- />
- </svg>
- <span>Chrome (coming soon)</span>
- <span
- class="icon"
- v-if="chromeExtInstalled"
- v-tooltip="$t('installed')"
- >
- <i class="material-icons">done</i>
- </span>
- </button>
+ <a
+ href="https://chrome.google.com/webstore/detail/postwoman-extension-for-c/amknoiejhlmhancpahfcfcfhllgkpbld"
+ target="_blank"
+ rel="noopener"
+ >
+ <button class="icon">
+ <svg
+ class="material-icons"
+ xmlns="http://www.w3.org/2000/svg"
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ >
+ <path
+ d="M2.897 4.181c2.43-2.828 5.763-4.181 9.072-4.181 4.288 0 8.535 2.273 10.717 6.554-2.722.001-6.984 0-9.293 0-1.674.001-2.755-.037-3.926.579-1.376.724-2.415 2.067-2.777 3.644l-3.793-6.596zm5.11 7.819c0 2.2 1.789 3.99 3.988 3.99s3.988-1.79 3.988-3.99-1.789-3.991-3.988-3.991-3.988 1.791-3.988 3.991zm5.536 5.223c-2.238.666-4.858-.073-6.293-2.549-1.095-1.891-3.989-6.933-5.305-9.225-1.33 2.04-1.945 4.294-1.945 6.507 0 5.448 3.726 10.65 9.673 11.818l3.87-6.551zm2.158-9.214c1.864 1.734 2.271 4.542 1.007 6.719-.951 1.641-3.988 6.766-5.46 9.248 7.189.443 12.752-5.36 12.752-11.972 0-1.313-.22-2.66-.69-3.995h-7.609z"
+ />
+ </svg>
+ <span>Chrome</span>
+ <span
+ class="icon"
+ v-if="chromeExtInstalled"
+ v-tooltip="$t('installed')"
+ >
+ <i class="material-icons">done</i>
+ </span>
+ </button>
+ </a>
</div>
</div>
<div slot="footer"></div>
@@ -612,6 +618,7 @@
<script>
import intializePwa from "../assets/js/pwa";
import * as version from "../.postwoman/version.json";
+import { hasChromeExtensionInstalled } from "../functions/strategies/ChromeStrategy";
export default {
components: {
@@ -639,7 +646,7 @@ export default {
showShortcuts: false,
showSupport: false,
firefoxExtInstalled: window.firefoxExtSendRequest,
- chromeExtInstalled: false
+ chromeExtInstalled: window.chrome && hasChromeExtensionInstalled()
};
},