Show renderer process PID in :buffer completion
This commit is contained in:
parent
fee0946296
commit
55e5279aa5
|
|
@ -126,6 +126,8 @@ Changed
|
|||
`content.headers.custom`, the custom value is now ignored for XHR
|
||||
(`XMLHttpRequest`) requests. Instead, the sent value is now `*/*` or the header
|
||||
set from JavaScript, as it would be if `content.headers.custom` wasn't set.
|
||||
- The `:buffer` completion now shows the underlying renderer process PID if
|
||||
doing so is supported (QtWebEngine 5.15).
|
||||
|
||||
Fixed
|
||||
~~~~~
|
||||
|
|
|
|||
|
|
@ -1172,6 +1172,14 @@ class AbstractTab(QWidget):
|
|||
self.data.pinned = pinned
|
||||
self.pinned_changed.emit(pinned)
|
||||
|
||||
def renderer_process_pid(self) -> Optional[int]:
|
||||
"""Get the PID of the underlying renderer process.
|
||||
|
||||
Returns None if the PID can't be determined or if getting the PID isn't
|
||||
supported.
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def __repr__(self) -> str:
|
||||
try:
|
||||
qurl = self.url()
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import math
|
|||
import functools
|
||||
import re
|
||||
import html as html_utils
|
||||
from typing import cast, Union
|
||||
from typing import cast, Union, Optional
|
||||
|
||||
from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QPoint, QPointF, QUrl, QObject
|
||||
from PyQt5.QtNetwork import QAuthenticator
|
||||
|
|
@ -1313,6 +1313,14 @@ class WebEngineTab(browsertab.AbstractTab):
|
|||
def title(self):
|
||||
return self._widget.title()
|
||||
|
||||
def renderer_process_pid(self) -> Optional[int]:
|
||||
page = self._widget.page()
|
||||
try:
|
||||
return page.renderProcessPid()
|
||||
except AttributeError:
|
||||
# Added in Qt 5.15
|
||||
return None
|
||||
|
||||
def icon(self):
|
||||
return self._widget.icon()
|
||||
|
||||
|
|
|
|||
|
|
@ -888,6 +888,9 @@ class WebKitTab(browsertab.AbstractTab):
|
|||
def title(self):
|
||||
return self._widget.title()
|
||||
|
||||
def renderer_process_pid(self) -> Optional[int]:
|
||||
return None
|
||||
|
||||
@pyqtSlot()
|
||||
def _on_history_trigger(self):
|
||||
url = self.url()
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ def _buffer(*, win_id_filter=lambda _win_id: True, add_win_id=True):
|
|||
window=int(win_id))
|
||||
tabbed_browser.on_tab_close_requested(int(tab_index) - 1)
|
||||
|
||||
model = completionmodel.CompletionModel(column_widths=(6, 40, 54))
|
||||
model = completionmodel.CompletionModel(column_widths=(6, 40, 46, 8))
|
||||
|
||||
tabs_are_windows = config.val.tabs.tabs_are_windows
|
||||
# list storing all single-tabbed windows when tabs_are_windows
|
||||
|
|
@ -131,14 +131,20 @@ def _buffer(*, win_id_filter=lambda _win_id: True, add_win_id=True):
|
|||
window=win_id)
|
||||
if tabbed_browser.is_shutting_down:
|
||||
continue
|
||||
tabs: List[Tuple[str, str, str]] = []
|
||||
tabs: List[Tuple[str, str, str, str]] = []
|
||||
for idx in range(tabbed_browser.widget.count()):
|
||||
tab = tabbed_browser.widget.widget(idx)
|
||||
tab_str = ("{}/{}".format(win_id, idx + 1) if add_win_id
|
||||
else str(idx + 1))
|
||||
tabs.append((tab_str,
|
||||
tab.url().toDisplayString(),
|
||||
tabbed_browser.widget.page_title(idx)))
|
||||
|
||||
pid = tab.renderer_process_pid()
|
||||
|
||||
tabs.append((
|
||||
tab_str,
|
||||
tab.url().toDisplayString(),
|
||||
tabbed_browser.widget.page_title(idx),
|
||||
"" if pid is None else f"PID {pid}",
|
||||
))
|
||||
|
||||
if tabs_are_windows:
|
||||
windows += tabs
|
||||
|
|
|
|||
|
|
@ -286,6 +286,9 @@ class FakeWebTab(browsertab.AbstractTab):
|
|||
def icon(self):
|
||||
return QIcon()
|
||||
|
||||
def renderer_process_pid(self):
|
||||
return None
|
||||
|
||||
|
||||
class FakeSignal:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue