mirror of
https://github.com/msojocs/wechat-web-devtools-linux.git
synced 2025-07-07 00:02:14 +08:00
25 lines
825 B
JavaScript
25 lines
825 B
JavaScript
#!/usr/bin/env node
|
|
const path = require("path");
|
|
const fs = require("fs");
|
|
const { spawn } = require("child_process");
|
|
|
|
const parseFile = function (path) {
|
|
|
|
console.log("fix start")
|
|
if (!fs.existsSync(path)) {
|
|
return;
|
|
}
|
|
console.log("content")
|
|
let content = JSON.parse(fs.readFileSync(path, "utf8"));
|
|
|
|
content.name = "wechat_devtools";
|
|
// 开启调试,更新参数
|
|
content['chromium-args'] = content['chromium-args'].replace('--disable-devtools', '').replace('--ignore-gpu-blacklist', '--ignore-gpu-blocklist') + ' --mixed-context'
|
|
content.window.height = content.window.width = 500
|
|
fs.writeFileSync(path, JSON.stringify(content));
|
|
|
|
};
|
|
|
|
parseFile(path.resolve(__dirname, "../package.nw/package.json"));
|
|
parseFile(path.resolve(__dirname, "../package.nw/package-lock.json"));
|