Commit Graph

2632 Commits

Author SHA1 Message Date
Florian Bruhin af835c26ad Update changelog 2024-10-15 12:00:25 +02:00
Florian Bruhin ffe7d00a62 Merge branch 'drop-py38' 2024-10-15 11:58:54 +02:00
Florian Bruhin ff5d4d3564 Avoid passing a parent to QProcess
With the upgrade to MarkupSafe 3.0, something funny happened when trying to pass
the GUIProcess object to jinja after launching a userscript:

    [...]
    File "[...]/qutebrowser/browser/qutescheme.py", line 291, in qute_process
        src = jinja.render('process.html', title=f'Process {pid}', proc=proc)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "[...]/qutebrowser/utils/jinja.py", line 123, in render
        return environment.get_template(template).render(**kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    [...]
    File "html/process.html", line 11, in block 'content'
    File "[...]/lib/python3.11/site-packages/markupsafe/__init__.py", line 42, in escape
        if hasattr(s, "__html__"):
           ^^^^^^^^^^^^^^^^^^^^^^
    RuntimeError: wrapped C/C++ object of type GUIProcess has been deleted

This can be reproduced with:

    qutebrowser --temp-basedir ':cmd-later 0 spawn -u -o /bin/echo test'

We pass the `GUIProcess` to the Jinja template as `proc`, which then formats it as
`{{ proc }}`` (to stringify it). For some reason, with the newest MarkupSafe/Jinja
versions, this now triggers the `if hasattr(s, "__html__")` check in MarkupSafe
(which has been around for a while). That then presumably causes PyQt to try and
access the underlying C++ object for `GUIProcess``, but that has already been
deleted.

But why is it deleted in the first place, if we keep track of even completed
processes data ever since we added `:process` in a3adba81c? It looks like the Qt
parent-child relationship is the culprit here: When we pass a parent to the
`GUIProcess`` from the userscript runner, it will get deleted as soon as said
runner is cleaned up (which happens after the userscript has finished).

We probably never noticed this before because we only accessed data from the
Python wrapper and not from the C++ side, but it still seems like a good idea
to avoid passing a parent for a long-lived object (with time-based cleanup) in
the first place.
2024-10-15 11:55:04 +02:00
Florian Bruhin 088b5973eb Update mimetype overrides
See https://github.com/python/cpython/commits/main/Lib/mimetypes.py
2024-10-15 11:55:04 +02:00
Florian Bruhin 463bde5c8e Update changelog 2024-10-15 10:33:53 +02:00
Florian Bruhin eb67b20417 Update docs for Python 3.8 drop 2024-10-13 18:24:44 +02:00
Florian Bruhin bd3774dfc8 Drop Python 3.8 from tox/CI 2024-10-13 18:24:44 +02:00
Florian Bruhin cc73134ead Add tenative v3.4.0 changelog 2024-10-12 21:50:07 +02:00
qutebrowser bot eacdca5a36 Release v3.3.1
(cherry picked from commit fc0d7e08bc)
2024-10-12 19:40:58 +00:00
Florian Bruhin 94dce5f1d4 Update release checklist 2024-10-12 21:38:20 +02:00
Florian Bruhin 7d6ea4b58b Fix up changelog 2024-10-12 21:37:17 +02:00
Florian Bruhin 5a8964dc48 Update changelog 2024-10-12 21:31:27 +02:00
Florian Bruhin 28480f394b Update the Firefox UA for quirks
See #5182
2024-10-12 21:31:27 +02:00
qutebrowser bot 7d1d6459e0 Release v3.3.0 2024-10-12 19:23:16 +00:00
toofar 3bc30e748d Merge pull request #8243 from feat/e2e_screenshots 2024-10-05 11:30:57 +13:00
Sviatoslav Sydorenko 0b6db05499
📝 Mention `kerberos` USE-flag on Gentoo
This flag is vital for the allow-list configuration to be picked up.
It should be set globally and `dev-qt/qtwebengine` should be
recompiled after it's enabled.

Ref #8313.
2024-09-30 15:37:00 +02:00
toofar 451cc6fd56 Refer to mkvenv script by full path in install docs
Might help with people copying and pasting commands. I don't think the
script installs itself in bin/ in the virtualenv it creates?

Closes: #8263
2024-08-18 13:23:02 +12:00
toofar 622b98df12 update changelog for e2e test screenshots 2024-08-18 12:43:40 +12:00
Florian Bruhin b9441cad45 Fix crash when the renderer process terminates for an unknown reason
With PyQt 6, this gets represented as
QWebEnginePage.RenderProcessTerminationStatus(-1)
which is != -1, thus leading to a KeyError.

Updating to a RendererProcessTerminationStatus
enum value works fine on both PyQt5 and PyQt6.
2024-08-04 21:00:50 +02:00
toofar c3f34a8a39 update docs and changelog for URL match patterns link 2024-07-27 11:20:17 +12:00
toofar 152571c9cd Merge pull request #8268 from greenfoo/update_match_patterns_link
Update link to chrome match patterns documentation
2024-07-27 11:13:16 +12:00
Fernando Ramos d65489da91 Update link to match patterns documentation 2024-07-21 21:53:18 +02:00
Florian Bruhin 564293fb6e Update pakjoy setting description 2024-07-12 16:33:14 +02:00
owl d9b9349656
Add setting to disable Google Hangouts extension
Fixes #8257
2024-07-12 12:36:50 +02:00
Florian Bruhin b78fc5765a ci: Drop macOS 11
Will be dropped on GitHub Actions tomorrow:
https://github.blog/changelog/2024-05-20-actions-upcoming-changes-to-github-hosted-macos-runners/

For unit tests, we now run them on macOS 13 instead, thus testing on all three
macOS versions we currently support.

For releases, this forces us to now support macOS 12 as the oldest supported
version and drop macOS 11 support. Thus, we should not have a v3.2.2 release.

Not backporting this commit so CI fails there rather than silently bumping up
requirements.
2024-06-27 22:04:40 +02:00
Florian Bruhin f377fd36d9 Fix up changelog
Cherry-picking 21ee2d093a resulted in an accidental v3.3.0 section in the changelog.
2024-06-25 11:19:55 +02:00
qutebrowser bot f9cfef973a Release v3.2.1
(cherry picked from commit 8cb4556245)
2024-06-25 09:07:53 +00:00
Florian Bruhin 547530e33c Move apple silicon releases to v3.2.1 2024-06-25 10:40:46 +02:00
Florian Bruhin 307245c8cf Update changelog 2024-06-25 10:06:27 +02:00
toofar d0422a982f Tips for contributors to run the webkit backend
My virtualenv I used to run webkit has rotted long ago and I don't remember
how I set it up. There is a PyQtWebKit project on PyPI but I don't know
who that's published by.

So I figured I would write some notes for myself on using the docker container
used for CI instead. I chose to mount the current directory (which is
presumably a qutebrowser checkout!) directly into the container instead of
cloning it so I could have quicker feedback between making code changes and
running tests.

Then there's a couple of things that stem from that. Since the user in the
container is different from the one in the host we have to move some things
that are normally written to the current directory to be written elsewhere.
There are other ways to approach this (eg you can add `-u $(id -u)` to the
docker command line, although that makes things a bit confusing in the
container) but arguably it's good for the container not to be able to write to
the host, hence making that volume read only.

The TOX_WORK_DIR trick is from
[here](https://github.com/tox-dev/tox/issues/20), apart from with
`{toxinidir}` in it too because the pyroma env was failing with just
`.tox`, saying the pyroma binary needed to be in the allowlist, possibly
it was doing full path matching without normalizing.

The hypothesis folks
[here](https://github.com/HypothesisWorks/hypothesis/issues/2367#issuecomment-595524571)
say if you want to override the examples DB location with an env var to
do it yourself. It's actually only a warning from hypothesis, it says it
falls back to an in-memory DB, but I guess the tests run with
warnings-are-errors. You can also pass `database=None` to make
hypothesis skip example storage altogether.

I'm using tox to run commands in a virtualenv with the right stuff in it
because, uh, because I was copying the CI workflow actually. I just found out
about the `exec` subcommand to override the `commands` defined for the env,
neat! One point of awkwardness about that is that since we are using the
PyQt from the OS we need any virtualenv we use to have access to the OS
packages, which isn't the default for virtualenvs created by tox. The
text envs use the link_pyqt script for that but if you are using this
container and the first thing you do is run `tox exec` then that
wouldn't have been run. So I'm setting `VIRTUALENV_SYSTEM_SITE_PACKAGES`
to tell tox to always make the system packages available in the
virtualenvs it manages.

I did try using the mkvenv script instead of tox but it complained when
trying to install the current directory in editable mode because
setup.py tries to write to a git-commit-id file.
2024-06-23 20:12:38 +12:00
toofar c57a280ef0 update docs for url:yank addition 2024-06-23 10:17:21 +12:00
toofar fcd68efd3c update changelog for 7879 and 7950
Move the entry about stripping query params up to the next minor release
and move it into the "changed" section, instead of "fixed".
2024-06-22 16:34:38 +12:00
toofar bab8596a68 Merge pull request #7879 from michaelfm1211/main
Move URL to yankable string conversion to urlutils
2024-06-22 16:30:35 +12:00
toofar 167d7ac87d update changelog for qute-pass idna 2024-06-16 11:24:23 +12:00
Florian Bruhin 27164d0d6e Build separate Apple Silicon release
With GitHub Actions now providing macOS 14 runners with M1 chips, we can
build a separate Apple Silicon release there and upload it.

Universal wheels are currently not possible, see #8229 for details.

Closes #6478
2024-06-11 23:01:47 +02:00
Florian Bruhin 1e1af23d34 Fix earlyinit with no Qt available
We need to wait with init_qtlog until after we know we have Qt available.

Closes #8220
2024-06-04 22:32:10 +02:00
qutebrowser bot ae7d7fb426 Release v3.2.0 2024-06-03 14:42:27 +00:00
Florian Bruhin 56f14fba2d Fix security patch version in changelog 2024-06-01 13:34:30 +02:00
Florian Bruhin d3dc1bf4c1 Update changelog 2024-05-29 08:45:28 +02:00
toofar e86ef0b2fd update changlog entry for pdf.js fix 2024-05-25 09:42:02 +12:00
toofar 1f2a0016b7 put windows IPC fix changelog in correct release [ci skip] 2024-05-25 09:40:44 +12:00
toofar 68a8d618d6 update changelog for flaky windows qtimer issue 2024-05-25 09:34:01 +12:00
toofar 04b0d84bda update changelog for None selection model fix 2024-05-19 14:34:23 +12:00
Florian Bruhin a7a7c434e2 Fix handling of missing QtWebEngine resources
I was getting crash reports from someone about this. Not sure what's going wrong
there (hence the additional information in the exception).

What's clear however is that we're raising ParseError, but only handling that
when actually parsing. The code calling copy_/_find_webengine_resources only
handles OSError. So let's raise a FileNotFoundError instead.
2024-05-10 18:41:50 +02:00
Evan Chen 350f94222d
reading comprehension failure
more coffee required
2024-05-09 13:35:13 -04:00
Evan Chen 310c865f29
Fix some spelling errors 2024-05-09 10:58:04 -04:00
Florian Bruhin edba6f18cb Update changelog 2024-05-01 00:30:41 +02:00
Florian Bruhin dfcfc686ce Support setting dark mode at runtime and with URL patterns
See #3636, #5542, #7743
2024-04-30 23:31:58 +02:00
Florian Bruhin 0fec3c7fb2 Update changelog 2024-04-30 17:15:22 +02:00
Florian Bruhin b0002ac71f Preload broken qutebrowser logo resource
When qutebrowser is running but its installation has been deleted/moved, it
fails in somewhat mysterious but predictable ways. This is e.g. the case
currently, when people upgrade their Archlinux packages and upgrade from Python
3.11 to 3.12. When doing that with qutebrowser open, on the next page load, it
will:

- Have a crashed renderer process, because (assumingly) the process executable
  is gone on disk.
- Which then causes us trying to render an error page, but that fails due to
  broken_qutebrowser_logo.png being gone from disk.
- The FileNotFoundError then causes jinja2 to import jinja2.debug at runtime,
  but that *also* fails because the jinja2 package is gone.

We work around this by loading the PNG into RAM early, and then using the cached
version instead. This amends b4a2352833 which did
the same with HTML/JS resources, but never for this PNG, which (looking at crash
logs) seems to be a somewhat common breakage.

Alternatives I've considered:

- Catching the FileNotFoundError and not showing an error page at all.
- Generating a PNG with an explanatory text via QPainter and returning that.

However, with the renderer process crash happening in the first place for
unknown reasons, it's unclear if the error page ever gets actually displayed...
Let's roll with this for now, and if this causes a repeating renderer process
crash, fix that separately (also see #5108).
2024-04-30 17:03:11 +02:00