mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
重新修改代码,尽可能缩小影响范围
This commit is contained in:
parent
563f077964
commit
bb92657901
@ -22,6 +22,7 @@ from .._functions.settings import Settings
|
|||||||
from .._functions.tools import PortFinder
|
from .._functions.tools import PortFinder
|
||||||
from .._functions.tools import raise_error
|
from .._functions.tools import raise_error
|
||||||
from .._pages.chromium_base import Timeout
|
from .._pages.chromium_base import Timeout
|
||||||
|
from .._pages.chromium_frame import ChromiumFrame
|
||||||
from .._pages.tabs import ChromiumTab, MixTab
|
from .._pages.tabs import ChromiumTab, MixTab
|
||||||
from .._units.downloader import DownloadManager
|
from .._units.downloader import DownloadManager
|
||||||
from .._units.setter import BrowserSetter
|
from .._units.setter import BrowserSetter
|
||||||
@ -457,10 +458,18 @@ class Chromium(object):
|
|||||||
:param owner: 使用该驱动的对象
|
:param owner: 使用该驱动的对象
|
||||||
:return: Driver对象
|
:return: Driver对象
|
||||||
"""
|
"""
|
||||||
d = self._drivers.get(tab_id, None)
|
if isinstance(owner, ChromiumFrame):
|
||||||
|
d = self._drivers.get(tab_id, None)
|
||||||
|
if not d:
|
||||||
|
d = Driver(tab_id, 'page', self.address)
|
||||||
|
d.owner = owner
|
||||||
|
self._drivers[tab_id] = d
|
||||||
|
self._all_drivers.setdefault(tab_id, set()).add(d)
|
||||||
|
return d
|
||||||
|
|
||||||
|
d = self._drivers.pop(tab_id, None)
|
||||||
if not d:
|
if not d:
|
||||||
d = Driver(tab_id, 'page', self.address)
|
d = Driver(tab_id, 'page', self.address)
|
||||||
self._drivers[tab_id] = d
|
|
||||||
d.owner = owner
|
d.owner = owner
|
||||||
self._all_drivers.setdefault(tab_id, set()).add(d)
|
self._all_drivers.setdefault(tab_id, set()).add(d)
|
||||||
return d
|
return d
|
||||||
|
Loading…
x
Reference in New Issue
Block a user