WebInspector
Superclasses: Object
- Constructors:
WebInspector(**properties)
Methods
- class WebInspector
- attach() None
Request
inspector
to be attached.The signal
WebInspector
::attach will be emitted. If the inspector is already attached it does nothing.
- detach() None
Request
inspector
to be detached.The signal
WebInspector
::detach will be emitted. If the inspector is already detached it does nothing.
- get_attached_height() int
Get the height that the inspector view when attached.
Get the height that the inspector view should have when it’s attached. If the inspector view is not attached this returns 0.
- get_can_attach() bool
Whether the
inspector
can be attached to the same window that contains the inspected view.Added in version 2.8.
- get_inspected_uri() str
Get the URI that is currently being inspected.
This can be
None
if nothing has been loaded yet in the inspected view, if the inspector has been closed or when inspected view was loaded from a HTML string instead of a URI.
- get_web_view() WebViewBase
Get the
WebViewBase
used to display the inspector.This might be
None
if the inspector hasn’t been loaded yet, or it has been closed.
Properties
Signals
- class WebInspector.signals
- attach() bool
Emitted when the inspector is requested to be attached to the window where the inspected web view is. If this signal is not handled the inspector view will be automatically attached to the inspected view, so you only need to handle this signal if you want to attach the inspector view yourself (for example, to add the inspector view to a browser tab).
To prevent the inspector view from being attached you can connect to this signal and simply return
True
.
- bring_to_front() bool
Emitted when the inspector should be shown.
If the inspector is not attached the inspector window should be shown on top of any other windows. If the inspector is attached the inspector view should be made visible. For example, if the inspector view is attached using a tab in a browser window, the browser window should be raised and the tab containing the inspector view should be the active one. In both cases, if this signal is not handled, the default implementation calls
present()
on the current toplevelWindow
of the inspector view.
- closed() None
Emitted when the inspector page is closed. If you are using your own inspector window, you should connect to this signal and destroy your window.
- detach() bool
Emitted when the inspector is requested to be detached from the window it is currently attached to. The inspector is detached when the inspector page is about to be closed, and this signal is emitted right before
WebInspector
::closed, or when the user clicks on the detach button in the inspector view to show the inspector in a separate window. In this case the signalWebInspector
::open-window is emitted after this one.To prevent the inspector view from being detached you can connect to this signal and simply return
True
.
- open_window() bool
Emitted when the inspector is requested to open in a separate window. If this signal is not handled, a
Window
with the inspector will be created and shown, so you only need to handle this signal if you want to use your own window. This signal is emitted afterWebInspector
::detach to show the inspector in a separate window after being detached.To prevent the inspector from being shown you can connect to this signal and simply return
True