Skip to content

Commit

Permalink
issue #112 - updated puppeteer version and fixed BG page retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
Manvel committed Apr 30, 2023
1 parent 6406c74 commit bb24ce4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"cba-components": "github:browser-automation/cba-components#master",
"copy-webpack-plugin": "^11.0.0",
"csso": "^5.0.5",
"puppeteer": "^5.3.0",
"puppeteer": "^19.11.1",
"webextension-polyfill": "^0.10.0",
"webpack": "^5.80.0"
},
Expand Down
6 changes: 4 additions & 2 deletions tests/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ function run()
"--no-sandbox"
]});
page = await browser.newPage();
const extensionName = "Chromium browser automation";
const targets = await browser.targets();
const backgroundPageTarget = targets.find(({ _targetInfo }) => _targetInfo.title.startsWith(extensionName) && _targetInfo.type === "background_page");
const backgroundPageTarget = targets.find((target) =>
target.url().startsWith("chrome-extension://") && target.type() === "background_page"
);

backgroundPage = await backgroundPageTarget.page();
const [,, extensionID] = backgroundPage.url().split('/');

Expand Down

0 comments on commit bb24ce4

Please sign in to comment.