run之后,我希望自动关闭浏览器,但是调用hide 无法生效,请问用法错误了吗?
run 返回的是promise,run 后不能再链式调用 hide(),

    window.exports = {
    'hello': {
    mode: 'list',
    args: {
    enter: async (action) => {
    const res = await utools.ubrowser.goto('https://yuanliao.info')
    .wait('button[title=退出]')
    .cookies('flarum_session')
    .run({ width: 1000, height: 800 })
    console.log(res);
    utools.ubrowser.hide()
    utools.clearUBrowserCache()
    utools.dbStorage.setItem('token', res[0].value)
    }
    }
    }}

    • dto 回复了此帖

      dto 感谢。还有一个问题,如果是none 模式,在enter中调用 ubrowser 打开浏览器,会直接闪退。
      推测原因,启动ubrowser,会使插件进入后台,失去焦点,插件就退出了。ubrowser 也跟着退出

        说点什么吧...
        闽ICP备18007474号