nodejs_chromium 1.1.16 → 1.1.18
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/index.js +14 -7
- package/package.json +3 -2
- package/src/chrome.js +6 -4
- package/src/cookies.js +2 -2
package/index.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import 'nodejs_patch';
|
|
2
|
+
import puppeteer from "puppeteer";
|
|
3
|
+
import {KnownDevices} from "puppeteer";
|
|
4
|
+
import {exec} from "child_process";
|
|
5
|
+
import fs from "fs";
|
|
6
|
+
import chrome from "./src/chrome.js";
|
|
7
|
+
|
|
8
|
+
// const puppeteer = require("puppeteer");
|
|
9
|
+
// const { KnownDevices } = require("puppeteer");
|
|
10
|
+
// const chrome = require("./src/chrome.js");
|
|
11
|
+
// const { exec } = require("child_process");
|
|
12
|
+
|
|
6
13
|
global.__UA__ = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36';
|
|
7
14
|
const mob_ua = 'Mozilla/5.0 (Linux; Android 13;Build/TKQ1.220905.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36';
|
|
8
|
-
const fs = require("fs");
|
|
15
|
+
// const fs = require("fs");
|
|
9
16
|
|
|
10
17
|
|
|
11
18
|
async function NormalClose(path) {
|
|
@@ -201,4 +208,4 @@ async function checkInstall(install = false) {
|
|
|
201
208
|
}
|
|
202
209
|
|
|
203
210
|
|
|
204
|
-
|
|
211
|
+
export default { newChrome, checkInstall }
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodejs_chromium",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.18",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "for pupeteer chromium",
|
|
5
6
|
"main": "index.js",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
9
|
},
|
|
9
10
|
"dependencies": {
|
|
10
|
-
"nodejs_patch": ">1.0.
|
|
11
|
+
"nodejs_patch": ">1.0.20",
|
|
11
12
|
"puppeteer": ">22.6.0"
|
|
12
13
|
},
|
|
13
14
|
"author": "laoCC",
|
package/src/chrome.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import { URL } from "url";
|
|
3
|
+
import Cookies from "./cookies.js";
|
|
4
|
+
// const Cookies = require("./cookies");
|
|
5
|
+
// const { URL } = require('url');
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
*
|
|
@@ -11,7 +13,7 @@ const { URL } = require('url');
|
|
|
11
13
|
*
|
|
12
14
|
* @type {exports}
|
|
13
15
|
*/
|
|
14
|
-
|
|
16
|
+
export default class {
|
|
15
17
|
browser = void 0;
|
|
16
18
|
page = void 0;
|
|
17
19
|
responseCall = void 0;
|
package/src/cookies.js
CHANGED