@iflyrpa/playwright 1.2.65-beta.6 → 1.2.65-beta.8
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/dist/index.cjs +39 -14
- package/dist/index.js +39 -14
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -2557,7 +2557,7 @@ var __webpack_exports__ = {};
|
|
|
2557
2557
|
RpaTask: ()=>RpaTask
|
|
2558
2558
|
});
|
|
2559
2559
|
const actions_namespaceObject = require("@iflyrpa/actions");
|
|
2560
|
-
var package_namespaceObject = JSON.parse('{"i8":"1.2.65-beta.
|
|
2560
|
+
var package_namespaceObject = JSON.parse('{"i8":"1.2.65-beta.7"}');
|
|
2561
2561
|
const external_node_fs_namespaceObject = require("node:fs");
|
|
2562
2562
|
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
2563
2563
|
const external_node_path_namespaceObject = require("node:path");
|
|
@@ -5502,30 +5502,55 @@ app.on("window-all-closed", (e) => e.preventDefault());
|
|
|
5502
5502
|
enableBlinkFeatures: "AllowRunningInsecureContent"
|
|
5503
5503
|
}
|
|
5504
5504
|
});
|
|
5505
|
-
|
|
5506
|
-
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
|
|
5507
|
-
});
|
|
5508
|
-
if (pageParams.cookies) {
|
|
5505
|
+
if (pageParams.cookies && pageParams.cookies.length > 0) {
|
|
5509
5506
|
console.log(`准备设置${pageParams.cookies.length}个cookies`);
|
|
5510
|
-
console.log("第一个cookie:", pageParams.cookies[0]);
|
|
5511
5507
|
for(let i = 0; i < pageParams.cookies.length; i++){
|
|
5512
5508
|
const cookie = pageParams.cookies[i];
|
|
5513
|
-
let domain = null == cookie ? void 0 : cookie.domain;
|
|
5514
|
-
if (
|
|
5509
|
+
let domain = (null == cookie ? void 0 : cookie.domain) || "";
|
|
5510
|
+
if (domain.startsWith(".")) domain = domain.slice(1);
|
|
5511
|
+
if (!domain) try {
|
|
5512
|
+
const urlObj = new URL(pageParams.url);
|
|
5513
|
+
domain = urlObj.hostname;
|
|
5514
|
+
} catch (e) {
|
|
5515
|
+
console.error(`无法从 URL 提取 domain: ${pageParams.url}`, e);
|
|
5516
|
+
continue;
|
|
5517
|
+
}
|
|
5515
5518
|
const cookieWithUrl = {
|
|
5516
|
-
|
|
5517
|
-
|
|
5519
|
+
name: cookie.name,
|
|
5520
|
+
value: cookie.value,
|
|
5521
|
+
url: `http${cookie.secure ? "s" : ""}://${domain}${cookie.path || "/"}`,
|
|
5522
|
+
domain: domain,
|
|
5523
|
+
path: cookie.path || "/",
|
|
5524
|
+
secure: cookie.secure || false,
|
|
5525
|
+
httpOnly: cookie.httpOnly || false,
|
|
5526
|
+
expirationDate: cookie.expires
|
|
5518
5527
|
};
|
|
5528
|
+
console.log(`设置 Cookie [${i + 1}/${pageParams.cookies.length}]:`, {
|
|
5529
|
+
name: cookieWithUrl.name,
|
|
5530
|
+
domain: cookieWithUrl.domain,
|
|
5531
|
+
url: cookieWithUrl.url,
|
|
5532
|
+
secure: cookieWithUrl.secure
|
|
5533
|
+
});
|
|
5519
5534
|
try {
|
|
5520
5535
|
await electron.session.defaultSession.cookies.set(cookieWithUrl);
|
|
5521
|
-
console.log(
|
|
5536
|
+
console.log(`✓ Cookie 设置成功: ${cookie.name}`);
|
|
5522
5537
|
} catch (error) {
|
|
5523
|
-
console.error(
|
|
5538
|
+
console.error(`✗ Cookie 设置失败: ${cookie.name}`, error);
|
|
5539
|
+
console.error("Cookie 详情:", JSON.stringify(cookieWithUrl, null, 2));
|
|
5524
5540
|
}
|
|
5525
5541
|
}
|
|
5526
|
-
console.log("cookies设置完成");
|
|
5527
|
-
|
|
5542
|
+
console.log("所有 cookies 设置完成");
|
|
5543
|
+
try {
|
|
5544
|
+
const allCookies = await electron.session.defaultSession.cookies.get({});
|
|
5545
|
+
console.log(`当前 session 中共有 ${allCookies.length} 个 cookies`);
|
|
5546
|
+
if (allCookies.length > 0) console.log("已设置的 cookies:", allCookies.map((c)=>`${c.name}@${c.domain}`).join(", "));
|
|
5547
|
+
} catch (e) {
|
|
5548
|
+
console.error("验证 cookies 失败:", e);
|
|
5549
|
+
}
|
|
5528
5550
|
}
|
|
5551
|
+
await window1.loadURL(pageParams.url, {
|
|
5552
|
+
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
|
|
5553
|
+
});
|
|
5529
5554
|
}, {
|
|
5530
5555
|
pageParams
|
|
5531
5556
|
})
|
package/dist/index.js
CHANGED
|
@@ -2550,7 +2550,7 @@ function __webpack_require__(moduleId) {
|
|
|
2550
2550
|
});
|
|
2551
2551
|
};
|
|
2552
2552
|
})();
|
|
2553
|
-
var package_namespaceObject = JSON.parse('{"i8":"1.2.65-beta.
|
|
2553
|
+
var package_namespaceObject = JSON.parse('{"i8":"1.2.65-beta.7"}');
|
|
2554
2554
|
function _define_property(obj, key, value) {
|
|
2555
2555
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
2556
2556
|
value: value,
|
|
@@ -5478,30 +5478,55 @@ class Task {
|
|
|
5478
5478
|
enableBlinkFeatures: "AllowRunningInsecureContent"
|
|
5479
5479
|
}
|
|
5480
5480
|
});
|
|
5481
|
-
|
|
5482
|
-
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
|
|
5483
|
-
});
|
|
5484
|
-
if (pageParams.cookies) {
|
|
5481
|
+
if (pageParams.cookies && pageParams.cookies.length > 0) {
|
|
5485
5482
|
console.log(`准备设置${pageParams.cookies.length}个cookies`);
|
|
5486
|
-
console.log("第一个cookie:", pageParams.cookies[0]);
|
|
5487
5483
|
for(let i = 0; i < pageParams.cookies.length; i++){
|
|
5488
5484
|
const cookie = pageParams.cookies[i];
|
|
5489
|
-
let domain = null == cookie ? void 0 : cookie.domain;
|
|
5490
|
-
if (
|
|
5485
|
+
let domain = (null == cookie ? void 0 : cookie.domain) || "";
|
|
5486
|
+
if (domain.startsWith(".")) domain = domain.slice(1);
|
|
5487
|
+
if (!domain) try {
|
|
5488
|
+
const urlObj = new URL(pageParams.url);
|
|
5489
|
+
domain = urlObj.hostname;
|
|
5490
|
+
} catch (e) {
|
|
5491
|
+
console.error(`无法从 URL 提取 domain: ${pageParams.url}`, e);
|
|
5492
|
+
continue;
|
|
5493
|
+
}
|
|
5491
5494
|
const cookieWithUrl = {
|
|
5492
|
-
|
|
5493
|
-
|
|
5495
|
+
name: cookie.name,
|
|
5496
|
+
value: cookie.value,
|
|
5497
|
+
url: `http${cookie.secure ? "s" : ""}://${domain}${cookie.path || "/"}`,
|
|
5498
|
+
domain: domain,
|
|
5499
|
+
path: cookie.path || "/",
|
|
5500
|
+
secure: cookie.secure || false,
|
|
5501
|
+
httpOnly: cookie.httpOnly || false,
|
|
5502
|
+
expirationDate: cookie.expires
|
|
5494
5503
|
};
|
|
5504
|
+
console.log(`设置 Cookie [${i + 1}/${pageParams.cookies.length}]:`, {
|
|
5505
|
+
name: cookieWithUrl.name,
|
|
5506
|
+
domain: cookieWithUrl.domain,
|
|
5507
|
+
url: cookieWithUrl.url,
|
|
5508
|
+
secure: cookieWithUrl.secure
|
|
5509
|
+
});
|
|
5495
5510
|
try {
|
|
5496
5511
|
await electron.session.defaultSession.cookies.set(cookieWithUrl);
|
|
5497
|
-
console.log(
|
|
5512
|
+
console.log(`✓ Cookie 设置成功: ${cookie.name}`);
|
|
5498
5513
|
} catch (error) {
|
|
5499
|
-
console.error(
|
|
5514
|
+
console.error(`✗ Cookie 设置失败: ${cookie.name}`, error);
|
|
5515
|
+
console.error("Cookie 详情:", JSON.stringify(cookieWithUrl, null, 2));
|
|
5500
5516
|
}
|
|
5501
5517
|
}
|
|
5502
|
-
console.log("cookies设置完成");
|
|
5503
|
-
|
|
5518
|
+
console.log("所有 cookies 设置完成");
|
|
5519
|
+
try {
|
|
5520
|
+
const allCookies = await electron.session.defaultSession.cookies.get({});
|
|
5521
|
+
console.log(`当前 session 中共有 ${allCookies.length} 个 cookies`);
|
|
5522
|
+
if (allCookies.length > 0) console.log("已设置的 cookies:", allCookies.map((c)=>`${c.name}@${c.domain}`).join(", "));
|
|
5523
|
+
} catch (e) {
|
|
5524
|
+
console.error("验证 cookies 失败:", e);
|
|
5525
|
+
}
|
|
5504
5526
|
}
|
|
5527
|
+
await window1.loadURL(pageParams.url, {
|
|
5528
|
+
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
|
|
5529
|
+
});
|
|
5505
5530
|
}, {
|
|
5506
5531
|
pageParams
|
|
5507
5532
|
})
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iflyrpa/playwright",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.2.65-beta.
|
|
4
|
+
"version": "1.2.65-beta.8",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"extract-zip": "^2.0.1",
|
|
29
29
|
"loglevel": "^1.9.2",
|
|
30
30
|
"@iflyrpa/pacote": "1.0.1",
|
|
31
|
-
"@iflyrpa/actions": "2.0.0-beta.
|
|
31
|
+
"@iflyrpa/actions": "2.0.0-beta.8",
|
|
32
32
|
"@iflyrpa/share": "0.0.18-beta.0"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|