Skip to content

Commit

Permalink
preparations for multiple windows (#2977)
Browse files Browse the repository at this point in the history
* little refactoring

* fix other
  • Loading branch information
AlexKamaev authored Dec 20, 2023
1 parent 302a39d commit 7b92fc6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/client/sandbox/child-window/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default class ChildWindowSandbox extends SandboxBase {
windowParams = windowParams || DEFAULT_WINDOW_PARAMETERS;
windowName = windowName || windowId;

const newPageUrl = urlUtils.getPageProxyUrl(url, windowId, settings.get().nativeAutomation);
const newPageUrl = urlUtils.getPageProxyUrl(url, windowId, settings.nativeAutomation);
const targetWindow = window || this.window;
const beforeWindowOpenedEventArgs = { isPrevented: false };

Expand All @@ -68,7 +68,7 @@ export default class ChildWindowSandbox extends SandboxBase {
if (beforeWindowOpenedEventArgs.isPrevented)
return null;

const startPageUrl = settings.get().nativeAutomation ? SPECIAL_BLANK_PAGE : newPageUrl;
const startPageUrl = settings.nativeAutomation ? SPECIAL_BLANK_PAGE : newPageUrl;
const openedWindow = nativeMethods.windowOpen.call(targetWindow, startPageUrl, windowName, windowParams);

this._tryToStoreChildWindow(openedWindow, getTopOpenerWindow());
Expand Down Expand Up @@ -103,7 +103,7 @@ export default class ChildWindowSandbox extends SandboxBase {

handleClickOnLinkOrArea (el: HTMLLinkElement | HTMLAreaElement): void {
if (!settings.get().allowMultipleWindows) {
if (settings.get().nativeAutomation)
if (settings.nativeAutomation)
this._handleClickOnLinkOrAreaInNativeAutomation(el);

return;
Expand Down Expand Up @@ -191,7 +191,7 @@ export default class ChildWindowSandbox extends SandboxBase {

_handleFormSubmitting (window: Window): void {
if (!settings.get().allowMultipleWindows) {
if (settings.get().nativeAutomation)
if (settings.nativeAutomation)
this._handleFormSubmittingInNativeAutomation(window);

return;
Expand All @@ -205,7 +205,7 @@ export default class ChildWindowSandbox extends SandboxBase {
!ChildWindowSandbox._shouldOpenInNewWindowOnElementAction(form, DefaultTarget.form))
return;

const isNativeAutomation = settings.get().nativeAutomation;
const isNativeAutomation = settings.nativeAutomation;
const aboutBlankUrl = urlUtils.getProxyUrl(SPECIAL_BLANK_PAGE, void 0, isNativeAutomation);
const openedInfo = this._openUrlInNewWindow(aboutBlankUrl, void 0, void 0, void 0, form);

Expand Down

0 comments on commit 7b92fc6

Please sign in to comment.