Skip to content

Commit

Permalink
refactor: resolve browser via env variables based on build rather tha…
Browse files Browse the repository at this point in the history
…n user agent (#27179)

Fixes #26911,
#26860.

Currently, we are parsing user agent string to determine which browser
is running the extension. This doesn't work well with custom user
agents, and sometimes when user turns on mobile dev mode in Firefox, we
stop resolving that this is a Firefox browser, extension starts to use
Chrome API's and fails to inject.

Changes:
Since we are building different extensions for all supported browsers
(Chrome, Firefox, Edge), we predefine env variables for browser
resolution, which are populated in a build step.

DiffTrain build for commit 2c4c847.
  • Loading branch information
hoxyq committed Aug 29, 2023
1 parent 315042d commit 5a73299
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23986,7 +23986,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-canary-41e9c17a6-20230829";
var ReactVersion = "18.3.0-canary-2c4c84718-20230829";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8612,7 +8612,7 @@ var devToolsConfig$jscomp$inline_1027 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-41e9c17a6-20230829",
version: "18.3.0-canary-2c4c84718-20230829",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1226 = {
Expand Down Expand Up @@ -8643,7 +8643,7 @@ var internals$jscomp$inline_1226 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-41e9c17a6-20230829"
reconcilerVersion: "18.3.0-canary-2c4c84718-20230829"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1227 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9038,7 +9038,7 @@ var devToolsConfig$jscomp$inline_1069 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-41e9c17a6-20230829",
version: "18.3.0-canary-2c4c84718-20230829",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1267 = {
Expand Down Expand Up @@ -9069,7 +9069,7 @@ var internals$jscomp$inline_1267 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-41e9c17a6-20230829"
reconcilerVersion: "18.3.0-canary-2c4c84718-20230829"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1268 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (
}
"use strict";

var ReactVersion = "18.3.0-canary-41e9c17a6-20230829";
var ReactVersion = "18.3.0-canary-2c4c84718-20230829";

// ATTENTION
// When adding new symbols to this file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,4 +616,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-41e9c17a6-20230829";
exports.version = "18.3.0-canary-2c4c84718-20230829";
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-41e9c17a6-20230829";
exports.version = "18.3.0-canary-2c4c84718-20230829";

/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
41e9c17a69f819f20a29823a0acf18456c5ef4d2
2c4c84718810bf3df411d599acc152d08208d35f

0 comments on commit 5a73299

Please sign in to comment.