Skip to content

Commit

Permalink
Merge pull request #1348 from doronz88/bugfix/opened-tabs
Browse files Browse the repository at this point in the history
webinspector: fix opened-tabs to use new `ApplicationPage` object
  • Loading branch information
doronz88 authored Feb 3, 2025
2 parents dc6ccbc + 7b9d52e commit 4976fc0
Showing 1 changed file with 4 additions and 16 deletions.
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

0 comments on commit 4976fc0

Please sign in to comment.