Merge branch 'Ban3-visibility-api'
This commit is contained in:
commit
d59589cbff
@ -43,6 +43,8 @@ Added
|
|||||||
- New `:debug-log-level` command to change the console loglevel on-the-fly.
|
- New `:debug-log-level` command to change the console loglevel on-the-fly.
|
||||||
- New `general -> yank-ignored-url-parameters` option to configure which URL
|
- New `general -> yank-ignored-url-parameters` option to configure which URL
|
||||||
parameters (like `utm_source` etc.) to strip off when yanking an URL.
|
parameters (like `utm_source` etc.) to strip off when yanking an URL.
|
||||||
|
- Support for the
|
||||||
|
https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API[HTML5 page visibility API]
|
||||||
|
|
||||||
Changed
|
Changed
|
||||||
~~~~~~~
|
~~~~~~~
|
||||||
|
@ -197,6 +197,7 @@ Contributors, sorted by the number of commits in descending order:
|
|||||||
* Michał Góral
|
* Michał Góral
|
||||||
* Michael Ilsaas
|
* Michael Ilsaas
|
||||||
* Martin Zimmermann
|
* Martin Zimmermann
|
||||||
|
* Jussi Timperi
|
||||||
* Fritz Reichwald
|
* Fritz Reichwald
|
||||||
* Brian Jackson
|
* Brian Jackson
|
||||||
* sbinix
|
* sbinix
|
||||||
|
@ -72,6 +72,14 @@ class WebView(QWebView):
|
|||||||
|
|
||||||
page = webpage.BrowserPage(self.win_id, self._tab_id, tab.data,
|
page = webpage.BrowserPage(self.win_id, self._tab_id, tab.data,
|
||||||
parent=self)
|
parent=self)
|
||||||
|
|
||||||
|
try:
|
||||||
|
page.setVisibilityState(
|
||||||
|
QWebPage.VisibilityStateVisible if self.isVisible()
|
||||||
|
else QWebPage.VisibilityStateHidden)
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
self.setPage(page)
|
self.setPage(page)
|
||||||
|
|
||||||
mode_manager = objreg.get('mode-manager', scope='window',
|
mode_manager = objreg.get('mode-manager', scope='window',
|
||||||
@ -240,3 +248,35 @@ class WebView(QWebView):
|
|||||||
self.shutting_down.connect(menu.close)
|
self.shutting_down.connect(menu.close)
|
||||||
modeman.instance(self.win_id).entered.connect(menu.close)
|
modeman.instance(self.win_id).entered.connect(menu.close)
|
||||||
menu.exec_(e.globalPos())
|
menu.exec_(e.globalPos())
|
||||||
|
|
||||||
|
def showEvent(self, e):
|
||||||
|
"""Extend showEvent to set the page visibility state to visible.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
e: The QShowEvent.
|
||||||
|
|
||||||
|
Return:
|
||||||
|
The superclass event return value.
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
self.page().setVisibilityState(QWebPage.VisibilityStateVisible)
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
super().showEvent(e)
|
||||||
|
|
||||||
|
def hideEvent(self, e):
|
||||||
|
"""Extend hideEvent to set the page visibility state to hidden.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
e: The QHideEvent.
|
||||||
|
|
||||||
|
Return:
|
||||||
|
The superclass event return value.
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
self.page().setVisibilityState(QWebPage.VisibilityStateHidden)
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
super().hideEvent(e)
|
||||||
|
Loading…
Reference in New Issue
Block a user