Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webinspector: fix opened-tabs to use new ApplicationPage object #1348

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions pymobiledevice3/cli/webinspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,23 +116,11 @@ def opened_tabs(service_provider: LockdownClient, verbose, timeout):
Opt-in:
Settings -> Safari -> Advanced -> Web Inspector
"""
inspector = WebinspectorService(lockdown=service_provider, loop=asyncio.get_event_loop())
inspector = WebinspectorService(lockdown=service_provider)
inspector.connect(timeout)
while not inspector.connected_application:
inspector.flush_input()
reload_pages(inspector)
for app_id, app_ in inspector.connected_application.items():
if app_id not in inspector.application_pages:
continue
if verbose:
print(f'{app_.name} id: {app_id}')
else:
print(app_.name)
for page_id, page in inspector.application_pages[app_id].items():
if verbose:
print(f' - {page.web_url} id: {page_id}')
else:
print(f' - {page.web_url}')
application_pages = inspector.get_open_application_pages(timeout=timeout)
for application_page in application_pages:
print(application_page)
inspector.close()


Expand Down
Loading