无法回调
javascriptCode选择background使用automaFetch无法获取结果
需要版本1.29.12
1.创建一个工作流
2.连接活动标签页和 javascript 工作块
3.在 javascript 中选择 background
4.写入方法
(async () => {
try {
const res = await automaFetch('text', { url: 'https://www.baidu.com' })
console.log('automaFetch res:', res);
await automaNextBlock();
} catch (error) {
console.error('automaFetch 测试错误:', error);
await automaNextBlock();
}
})();
5.脚本无法获取结果信息
正常情况
automaFetch 需要有接口响应
补充如下
我通过源码进行追踪发现 src\sandbox\utils\handleJavascriptBlock.js 这个文件中
window.top.postMessage(
{
type: 'automa-fetch',
data: { id: instanceId, type, resource },
},
'*'
);
没有找到监听这个 message 的处理,导致没有 response