Use new history page on webkit-ng.

This commit is contained in:
Imran Sobir 2017-04-04 19:20:55 +05:00
parent 3aaebe83fb
commit be254be13a

View File

@ -36,7 +36,7 @@ from PyQt5.QtCore import QUrlQuery
import qutebrowser import qutebrowser
from qutebrowser.config import config from qutebrowser.config import config
from qutebrowser.utils import (version, utils, jinja, log, message, docutils, from qutebrowser.utils import (version, utils, jinja, log, message, docutils,
objreg, usertypes) objreg, usertypes, qtutils)
from qutebrowser.misc import objects from qutebrowser.misc import objects
@ -257,9 +257,15 @@ def qute_history(url):
return 'text/html', json.dumps(history_data(start_time)) return 'text/html', json.dumps(history_data(start_time))
else: else:
try:
from PyQt5.QtWebKit import qWebKitVersion
is_webkit_ng = qtutils.is_qtwebkit_ng(qWebKitVersion())
except ImportError: # pragma: no cover
is_webkit_ng = False
if ( if (
config.get('content', 'allow-javascript') and config.get('content', 'allow-javascript') and
objects.backend == usertypes.Backend.QtWebEngine (objects.backend == usertypes.Backend.QtWebEngine or is_webkit_ng)
): ):
return 'text/html', jinja.render( return 'text/html', jinja.render(
'history.html', 'history.html',