Skip to content

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

Added toggle for using extensions to send requests

Andrew Bastinf1e752892dc7
diff --git a/lang/en-US.js b/lang/en-US.js
index 0847e18f6..2dfa17614 100644
--- a/lang/en-US.js
+++ b/lang/en-US.js
@@ -247,6 +247,7 @@ export default {
enter_curl: "Enter cURL",
empty: "Empty",
extensions: "Extensions",
+ extensions_use_toggle: "Use the browser extension to send requests (if present)",
extensions_info1: "Browser extension that simplifies access to Postwoman",
extensions_info2: "Get Postwoman browser extension!",
installed: "Installed",
diff --git a/pages/settings.vue b/pages/settings.vue
index f09131f8a..8300bb54c 100644
--- a/pages/settings.vue
+++ b/pages/settings.vue
@@ -141,6 +141,20 @@
</ul>
</pw-section>
+ <pw-section class="purple" :label="$t('extensions')" ref="extensions">
+ <ul>
+ <li>
+ <div class="flex-wrap">
+ <pw-toggle
+ :on="settings.EXTENSIONS_ENABLED"
+ @change="toggleSetting('EXTENSIONS_ENABLED')"
+ >
+ {{ $t("extensions_use_toggle") }}
+ </pw-toggle>
+ </div>
+ </li>
+ </ul>
+ </pw-section>
<pw-section class="blue" :label="$t('proxy')" ref="proxy">
<ul>
<li>
@@ -323,7 +337,11 @@ export default {
PROXY_URL:
this.$store.state.postwoman.settings.PROXY_URL ||
"https://postwoman.apollotv.xyz/",
- PROXY_KEY: this.$store.state.postwoman.settings.PROXY_KEY || ""
+ PROXY_KEY: this.$store.state.postwoman.settings.PROXY_KEY || "",
+ EXTENSIONS_ENABLED:
+ (typeof(this.$store.state.postwoman.settings.EXTENSIONS_ENABLED) !== 'undefined') ?
+ this.$store.state.postwoman.settings.EXTENSIONS_ENABLED
+ : true
},
doneButton: '<i class="material-icons">done</i>',
diff --git a/store/postwoman.js b/store/postwoman.js
index 870958d96..ab79729ef 100644
--- a/store/postwoman.js
+++ b/store/postwoman.js
@@ -56,7 +56,13 @@ export const SETTINGS_KEYS = [
* An array of properties to exclude from the URL.
* e.g. 'auth'
*/
- "URL_EXCLUDES"
+ "URL_EXCLUDES",
+
+ /**
+ * A boolean value indicating whether to use the browser extensions
+ * to run the requests
+ */
+ "EXTENSIONS_ENABLED"
];
export const state = () => ({