Skip to content

Commit

Permalink
do not calculate DEFAULT_PROXY_SETTINGS in native automation if possi…
Browse files Browse the repository at this point in the history
…ble (#2962)
  • Loading branch information
AlexKamaev committed Sep 11, 2023
1 parent 6eff9c0 commit df7a2c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "testcafe-hammerhead",
"description": "A powerful web-proxy used as a core for the TestCafe testing framework (https://github.com/DevExpress/testcafe).",
"version": "31.6.1",
"version": "31.6.2",
"homepage": "https://github.com/DevExpress/testcafe-hammerhead",
"bugs": {
"url": "https://github.com/DevExpress/testcafe-hammerhead/issues"
Expand Down
7 changes: 4 additions & 3 deletions src/client/utils/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ export const DEFAULT_PROXY_SETTINGS = (function () {
let proxyLocation = locationWindow.location;

while (!proxyLocation.hostname) {
// about:blank page in nativeAutomation mode
if (!globalContextInfo.isInWorker
&& locationWindow === (locationWindow as Window).top)
const isAboutBlankPageInNativeAutomation = !globalContextInfo.isInWorker && locationWindow === (locationWindow as Window).top;
const isFileProtocolPageInNativeAutomation = proxyLocation.protocol === 'file:';

if (isAboutBlankPageInNativeAutomation || isFileProtocolPageInNativeAutomation)
break;

locationWindow = locationWindow.parent;
Expand Down

0 comments on commit df7a2c4

Please sign in to comment.