@applitools/spec-driver-browser-extension 1.2.12 → 1.3.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,52 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.3.0](https://github.com/Applitools-Dev/sdk/compare/js/spec-driver-browser-extension@1.2.13...js/spec-driver-browser-extension@1.3.0) (2025-07-07)
4
+
5
+
6
+ ### Features
7
+
8
+ * canvas webgl without preserveDrawingBuffer=1 | FLD-3144 ([#3040](https://github.com/Applitools-Dev/sdk/issues/3040)) ([f82d8f1](https://github.com/Applitools-Dev/sdk/commit/f82d8f148f913098752ec7bef8635a46b453d6fa))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * @applitools/utils bumped to 1.9.0
14
+ #### Features
15
+
16
+ * support https_proxy and http_proxy env variables | FLD-2702 ([#3046](https://github.com/Applitools-Dev/sdk/issues/3046)) ([0633809](https://github.com/Applitools-Dev/sdk/commit/06338099f44bfb149a5829f62c2f9b19e2392850))
17
+ * @applitools/spec-driver-playwright bumped to 1.6.0
18
+ #### Features
19
+
20
+ * canvas webgl without preserveDrawingBuffer=1 | FLD-3144 ([#3040](https://github.com/Applitools-Dev/sdk/issues/3040)) ([f82d8f1](https://github.com/Applitools-Dev/sdk/commit/f82d8f148f913098752ec7bef8635a46b453d6fa))
21
+
22
+
23
+
24
+ * @applitools/logger bumped to 2.1.5
25
+
26
+ * @applitools/driver bumped to 1.22.0
27
+ #### Features
28
+
29
+ * canvas webgl without preserveDrawingBuffer=1 | FLD-3144 ([#3040](https://github.com/Applitools-Dev/sdk/issues/3040)) ([f82d8f1](https://github.com/Applitools-Dev/sdk/commit/f82d8f148f913098752ec7bef8635a46b453d6fa))
30
+
31
+
32
+
33
+
34
+ ## [1.2.13](https://github.com/Applitools-Dev/sdk/compare/js/spec-driver-browser-extension@1.2.12...js/spec-driver-browser-extension@1.2.13) (2025-05-11)
35
+
36
+
37
+ ### Dependencies
38
+
39
+ * @applitools/utils bumped to 1.8.2
40
+ #### Bug Fixes
41
+
42
+ * remove redundant file readings and added rendering concurrency limit ([#2956](https://github.com/Applitools-Dev/sdk/issues/2956)) ([b970180](https://github.com/Applitools-Dev/sdk/commit/b97018010fdf12cb0d202192b22f643c16c569d5))
43
+ * @applitools/logger bumped to 2.1.4
44
+
45
+ * @applitools/driver bumped to 1.21.4
46
+
47
+ * @applitools/spec-driver-playwright bumped to 1.5.13
48
+
49
+
3
50
  ## [1.2.12](https://github.com/Applitools-Dev/sdk/compare/js/spec-driver-browser-extension@1.2.11...js/spec-driver-browser-extension@1.2.12) (2025-05-07)
4
51
 
5
52
 
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.getUrl = exports.getTitle = exports.takeScreenshot = exports.getCookies = exports.setWindowSize = exports.getWindowSize = exports.getDriverInfo = exports.childContext = exports.parentContext = exports.mainContext = exports.findElements = exports.findElement = exports.executeScript = exports.extractContext = exports.toSelector = exports.isStaleElementError = exports.isSelector = exports.isElement = exports.isContext = exports.isDriver = void 0;
29
+ exports.getUrl = exports.getTitle = exports.takeScreenshot = exports.getCookies = exports.setWindowSize = exports.getWindowSize = exports.getDriverInfo = exports.childContext = exports.parentContext = exports.mainContext = exports.findElements = exports.findElement = exports.executeBrowserCommands = exports.executeScript = exports.extractContext = exports.toSelector = exports.isStaleElementError = exports.isSelector = exports.isElement = exports.isContext = exports.isDriver = void 0;
30
30
  const webextension_polyfill_1 = __importDefault(require("webextension-polyfill"));
31
31
  const utils = __importStar(require("@applitools/utils"));
32
32
  function isDriver(driver) {
@@ -85,6 +85,27 @@ async function executeScript(context, script, arg) {
85
85
  return result;
86
86
  }
87
87
  exports.executeScript = executeScript;
88
+ async function executeBrowserCommands(_driver, commands, logger) {
89
+ for (const currentCommand of commands) {
90
+ if (currentCommand.command === 'Page.addScriptToEvaluateOnNewDocument') {
91
+ const script = currentCommand.params.source;
92
+ webextension_polyfill_1.default.tabs.onUpdated.addListener((tabId, changeInfo, _tab) => {
93
+ if (changeInfo.status === 'loading') {
94
+ webextension_polyfill_1.default.scripting.executeScript({
95
+ target: { tabId: tabId },
96
+ func: eval(script),
97
+ });
98
+ }
99
+ });
100
+ logger === null || logger === void 0 ? void 0 : logger.debug('executeBrowserCommands');
101
+ }
102
+ else {
103
+ logger === null || logger === void 0 ? void 0 : logger.debug(`Unsupported Browser command: ${currentCommand.command}`);
104
+ }
105
+ // Add more command handling as needed
106
+ }
107
+ }
108
+ exports.executeBrowserCommands = executeBrowserCommands;
88
109
  async function findElement(context, selector, parent) {
89
110
  const [{ result }] = await webextension_polyfill_1.default.scripting.executeScript({
90
111
  target: { tabId: context.tabId, frameIds: [context.frameId || 0] },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/spec-driver-browser-extension",
3
- "version": "1.2.12",
3
+ "version": "1.3.0",
4
4
  "keywords": [
5
5
  "playwright",
6
6
  "chrome devtools protocol",
@@ -40,13 +40,13 @@
40
40
  "playwright:setup": "yarn playwright install --with-deps chromium"
41
41
  },
42
42
  "dependencies": {
43
- "@applitools/driver": "1.21.3",
44
- "@applitools/utils": "1.8.1",
43
+ "@applitools/driver": "1.22.0",
44
+ "@applitools/utils": "1.9.0",
45
45
  "webextension-polyfill": "0.10.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@applitools/api-extractor": "^1.2.22",
49
- "@applitools/spec-driver-playwright": "^1.5.12",
49
+ "@applitools/spec-driver-playwright": "^1.6.0",
50
50
  "@applitools/test-utils": "^1.5.17",
51
51
  "@babel/core": "^7.26.0",
52
52
  "@babel/preset-env": "^7.22.5",
@@ -1,5 +1,7 @@
1
1
  import type { Size } from '@applitools/utils';
2
2
  import type { SpecType, SpecDriver as BaseSpecDriver, CommonSelector, DriverInfo, Cookie } from '@applitools/driver';
3
+ import type { BrowserCommand } from '@applitools/driver';
4
+ import { Logger } from '@applitools/logger';
3
5
  import type { Ref } from './refer';
4
6
  export type Driver = {
5
7
  windowId: number;
@@ -30,6 +32,7 @@ export declare function isStaleElementError(error: any): boolean;
30
32
  export declare function toSelector(selector: CommonSelector<Selector>): Selector;
31
33
  export declare function extractContext(driver: Driver): Context;
32
34
  export declare function executeScript(context: Context, script: (arg: any) => any, arg?: any): Promise<any>;
35
+ export declare function executeBrowserCommands(_driver: Driver, commands: BrowserCommand[], logger?: Logger): Promise<any>;
33
36
  export declare function findElement(context: Context, selector: Selector, parent?: Element | Node): Promise<Element | null>;
34
37
  export declare function findElements(context: Context, selector: Selector, parent?: Element | Node): Promise<Element[]>;
35
38
  export declare function mainContext(context: Context): Promise<Context>;