@intuned/runtime-dev 1.6.0-dev-52-1 → 1.6.0-dev-52-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { BrowserContext } from "playwright-core";
1
+ import { BrowserContext } from "playwright";
2
2
  export declare const REMOTE_DEBUGGING_PORT = 9222;
3
3
  export declare const getChromiumLaunchArgs: () => string[];
4
4
  export declare function startOrRestartBrowser(): Promise<void>;
@@ -9,7 +9,7 @@ exports.saveSession = saveSession;
9
9
  exports.saveSessionFromOpenedBrowser = saveSessionFromOpenedBrowser;
10
10
  exports.startOrRestartBrowser = startOrRestartBrowser;
11
11
  var _child_process = require("child_process");
12
- var playwright = _interopRequireWildcard(require("playwright-core"));
12
+ var playwright = _interopRequireWildcard(require("playwright"));
13
13
  var fs = _interopRequireWildcard(require("fs-extra"));
14
14
  var _fileUtils = require("./utils/fileUtils");
15
15
  var _contextStorageStateHelpers = require("../../common/contextStorageStateHelpers");
@@ -1,4 +1,4 @@
1
- import * as playwright from "playwright-core";
1
+ import * as playwright from "playwright";
2
2
  interface StorageEntry {
3
3
  name: string;
4
4
  value: string;
@@ -30,7 +30,23 @@ async function setStorageState(context, state) {
30
30
  }
31
31
  }
32
32
  }
33
- if ("sessionStorage" in state && state.sessionStorage) {}
33
+ if ("sessionStorage" in state && state.sessionStorage) {
34
+ await context.addInitScript(storage => {
35
+ for (const {
36
+ origin,
37
+ sessionStorage
38
+ } of storage) {
39
+ if (window.location.origin === origin) {
40
+ for (const item of sessionStorage) {
41
+ const value = window.sessionStorage.getItem(item.name);
42
+ if (!value) {
43
+ window.sessionStorage.setItem(item.name, item.value);
44
+ }
45
+ }
46
+ }
47
+ }
48
+ }, state.sessionStorage);
49
+ }
34
50
  await page.close();
35
51
  }
36
52
  async function getStorageState(context) {
@@ -1,4 +1,4 @@
1
- import * as playwright from "playwright-core";
1
+ import * as playwright from "playwright";
2
2
  import type { RunApiSession } from "./runApi";
3
3
  interface Proxy {
4
4
  server: string;
@@ -7,7 +7,7 @@ exports.getPlaywrightConstructsForMode = getPlaywrightConstructsForMode;
7
7
  exports.getProductionPlaywrightConstructs = getProductionPlaywrightConstructs;
8
8
  exports.getRemotePlaywrightContext = getRemotePlaywrightContext;
9
9
  exports.loadSessionToContext = loadSessionToContext;
10
- var playwright = _interopRequireWildcard(require("playwright-core"));
10
+ var playwright = _interopRequireWildcard(require("playwright"));
11
11
  var _fsExtra = _interopRequireWildcard(require("fs-extra"));
12
12
  var fs = _fsExtra;
13
13
  var _contextStorageStateHelpers = require("./contextStorageStateHelpers");
@@ -163,7 +163,7 @@ async function loadSessionToContext({
163
163
  await (0, _contextStorageStateHelpers.setStorageState)(context, sessionToLoad);
164
164
  }
165
165
  async function getRemotePlaywrightContext(cdpAddress) {
166
- const playwright = await Promise.resolve().then(() => _interopRequireWildcard(require("playwright-core")));
166
+ const playwright = await Promise.resolve().then(() => _interopRequireWildcard(require("playwright")));
167
167
  let browser = null;
168
168
  if (!cdpAddress) {
169
169
  throw new Error("cdpAddress is required");
@@ -1,6 +1,6 @@
1
1
  import { Result } from "neverthrow";
2
2
  import { RunAutomationError } from "./errors";
3
- import { Page, BrowserContext } from "playwright-core";
3
+ import { Page, BrowserContext } from "playwright";
4
4
  import { ExtendedRunApiParameters, RunApiResult, RunApiResultWithSessionOk } from "./types";
5
5
  export * from "./types";
6
6
  export * from "./errors";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime-dev",
3
- "version": "1.6.0-dev-52-1",
3
+ "version": "1.6.0-dev-52-3",
4
4
  "description": "Intuned runtime",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
@@ -130,7 +130,6 @@
130
130
  "vitest": "^1.1.3"
131
131
  },
132
132
  "peerDependencies": {
133
- "playwright": "*",
134
- "playwright-core": "*"
133
+ "playwright": "*"
135
134
  }
136
135
  }