steam提供了通过打开游戏和特定3D模型来检查3D项目的链接。这样的链接看起来像这样:
steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20S76561198808861484A14783070567D17060211998222859457
如果在浏览器中单击此链接,它会要求确认打开“Steam客户端引导程序”然后运行游戏(或者您选中一个框以便它不会再次询问)。
我想创建一个节点脚本,可以打开这样的链接(可能通过chrome)并运行游戏。
我试过chrome-launcher:
const chromeLauncher = require('chrome-launcher');
inspect("steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20S76561198808861484A14783070567D17060211998222859457")
function inspect(link){
chromeLauncher.launch({
startingUrl: link
}).then(chrome => {
console.log(`Chrome debugging port running on ${chrome.port}`);
});
}
以及opn模块:
const opn = require('opn');
inspect("steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20S76561198808861484A14783070567D17060211998222859457")
function inspect(link){
opn(link, {app: 'chrome'});
}
这两个都有相同的结果:
有关如何做到这一点的任何想法?
提前致谢!
删除app参数,使其使用标准浏览器。