From 2d6d1b2d348875390e356ca5d5fc28a53e9783ce Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Tue, 21 Jan 2020 20:01:22 -0500 Subject: [PATCH] Added Chrome Strategy as a valid network strategy --- functions/network.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/functions/network.js b/functions/network.js index a2c885be5..4cb992b38 100644 --- a/functions/network.js +++ b/functions/network.js @@ -1,8 +1,13 @@ import AxiosStrategy from "./strategies/AxiosStrategy"; import FirefoxStrategy from "./strategies/FirefoxStrategy"; - +import ChromeStrategy, { hasChromeExtensionInstalled } from "~/functions/strategies/ChromeStrategy"; const runAppropriateStrategy = (req, store) => { + // Chrome Provides a chrome object for scripts to access + // Check its availability to say whether you are in Google Chrome + if (window.chrome && hasChromeExtensionInstalled()) { + return ChromeStrategy(req, store); + } // The firefox plugin injects a function to send requests through it // If that is available, then we can use the FirefoxStrategy if (window.firefoxExtSendRequest) {