mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
修复关闭当前标签页出错问题
This commit is contained in:
parent
cf8e00bb94
commit
716d8df5aa
@ -104,8 +104,8 @@ class ChromiumPage(ChromiumBase):
|
|||||||
@property
|
@property
|
||||||
def tabs(self):
|
def tabs(self):
|
||||||
"""返回所有标签页id组成的列表"""
|
"""返回所有标签页id组成的列表"""
|
||||||
tabs = self.run_cdp('Target.getTargets', filter=[{'type': "page"}])['targetInfos']
|
j = self._control_session.get(f'http://{self.address}/json').json()
|
||||||
return [i['targetId'] for i in tabs]
|
return [i['id'] for i in j if i['type'] == 'page']
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def main_tab(self):
|
def main_tab(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user