Before, we just returned the same data for both, but then we'll run into
same-origin restrictions as qute:history and qute:history/data are not the same
host.
From the spec:
User agents should ensure, e.g. by means of an overlay, that the end user is
aware something is displayed fullscreen. User agents should provide a means of
exiting fullscreen that always works and advertise this to the user. This is
to prevent a site from spoofing the end user by recreating the user agent or
even operating system environment when fullscreen.
https://fullscreen.spec.whatwg.org/#security-and-privacy-considerations
Before, the module regexes didn't actually work properly, but we thought the
warnings were gone as they only were shown once because of __pycache__.
Now we instead don't filter by module, but simply hide those messages globally
during the earlyinit dependency import (which is the first import).
Moved pin information from BrowserTab to TabData.
Changed attribute from pin to pinned.
Changed "ifs" to implicit check boolen value.
Removed blancked line on before else statement.
Done so far:
Two new commands pin/unpin, both accept a index to help the organization
(maybe this should be more a flag and not exactly two commands)
Crtl+p to pin, Crtl+O to unpin (not sure which should a good default
shortcut)
If user tries to close a pinned tab it's asked to confirm
If user tries to open a URL in a pinned tab it receives a message with a
information that the tab is pinned and ignore the openurl command
Preserve the pinned information across restart if session is activated
Missing:
Visual indication of the tab being pinned
Tab appearance being distinct over other tabs
Make pinned tabs to be the firsts on the tab bar
This is not ready, but it would be good to get some feedback earlier
CommandRunner.parse had some logic for handling commands of form
:<count>:cmd. However, this complicated the parsing logic for something
that appears to only be used in tests. One could use it in a
userscript, but this is unlikely as it is undocumented. Removing
support for this simplifies the logic of parse.
The commnd `run-with-count` is added to provide this functionality.
It works like `repeat` but passes the count along to the command
instead of running the command multiple times.
This resolves#1997: Qutebrowser crashes when pasting commands.
This bug was caused by excess stripping of ':' from the command string
by _parse_count.
We already had some duplicated logic for completion/keyhint/messageview,
and plan to add prompt overlays too now - so here we refactor related
code to have a list of overlays instead, which are all
resized/positioned by the mainwindow when needed.
This also changes the size management, which gets moved into the
sizeHint of the respective overlay widgets.
Fixes#1911.
The bugfix is backported in my qt5-webengine-debug package, and
QUTE_QTBUG54419_PATCHED can be set to force qutebrowser to use
createWindow.
This changes the message so it resembles the default choices=... one,
and also changes the argument to "filters" because that sounds nicer as
a metavar.
On windows, only one process can open a file in write mode at once. We
didn't close the handle we got (self._oshandle) before _cleanup, which
means that we had the file open the whole time, which means that the
external editor couldn't write back the changes.
This patch closes the file while the external editor is running and only
opens it once the editor is closed. We re-opened the file anyway, so
this shouldn't be a huge change. Additionally, tempfile.NamedTemporaryFile
is used instead of mkstemp, as we don't have to deal with os-level file
handles that way.
This makes commands like `:open web.archive.org/web/{url}` possible.
This commit also adds a no_replace_variables command register argument
that stops the replacement from happening, which is important for
commands like `:bind` and `:spawn` that take a command as an argument.
unix_filename_rubout deletes to the previous slash or whitespace,
unlike the previously implemented backwards-kill-word which treats and
non-alphanumeric character as a boundary.
To illustrate, given the text 'foo/bar.baz', unix_filename_rubout will
delete 'bar.baz' while backwards-kill-word will delete only 'baz'.
See #1710.
This restores the previous behavior of `unix-word-rubout` as
`backward-kill-word`, which is closer to the naming used in readline.
It is bound to <Alt-Backspace> by default, though <Ctrl-Backspace> will
also work due to a builtin binding.
Resolves#1698.
Per one of the diff comments on #1597:
> I used to use a tuple for constant things, but nowadays I'd actually
> prefer a list as a tuple is something more heterogeneous (i.e. it
> makes sense to have a `(x, y)` point as a tuple, but a list of points
> would be a list).
> At some point I should probably change it to a list everywhere 😉
Replace the setting ui.show-keyhints with ui.keyhint-blacklist, which
is a list of globs for keychains that shouldn't be hinted. This allows
users to prevent showing keyhints for keychains they already know.
keyhint-blacklist='*' is equivalent to show-keyhints=False.
Resolves#1515.
If a user knows the keychain and can type it quickly, we shouldn't
annoy them with a popup. Only show the keyhint if the user doesn't
complete their keychain in 500ms.
The isVisible() check in the tests is somewhat invalid now because it
is never immediately visible and I don't want to add a delay to unit
tests. I added a check that text() is not set for one test that was
only checking isVisible().
Addresses part of #1515.
The check `key.startswith('<') and key.endswith('>') is repeated many
times in code to check for a special key. Replace all these with a call
to the same function.
Currently, the keyhint window is shown even if the keystring matches no
possible bindings. This causes an empty keyhint window to hang around
after entering hinting mode.
Instead, the window is now hidden if no bindings match the current
keystring.
Resolves#1507.
This means:
- An annotation like (int, str) is now typing.Union[int, str].
- utils.typing got expanded so it acts like the real typing.py, with
issubclass() working properly with typing.Union and __union_params__
being set.
- A literal string doesn't exist anymore as annotation, instead
@cmdutils.argument now has a 'choices' argument which can be used like
@cmdutils.argument('arg', choices=['val1', 'val2']).
- Argument validating/converting is now entirely handled by
argparser.type_conv instead of relying on python's argparse, i.e.
type/choices is now not passed to argparse anymore.
Previously, negative bottom padding was used (probably to compensate
for a trailing <br>). With the table format, this is no longer
necessary and causes the last line to be drawn too low.
Don't show special keys in the keyhint window as these currently cannot
be part of keychains.
Use a rounded border on the top-right corner and square on the rest.
From code review:
- escape all strings used in the keyhint html
- read the prefix color each time the hint is shown
- use show/hide instead of setVisible
- clean up pylint/flake8 errors
- use CssColor instead of QssColor for keyhint.fg.suffix
- add some padding to the keyhint popup
When the current keystring is a partial match for one or more bindings,
show the possible bindings in a small overlay.
The overlay is partially transparent by default, but the background
color is configurable as ui->keystring.bg.
Before we used a {'nargs': '*'} annotation for the respective argument
to tell qutebrowser it's optional for the commandline. Now we instead
use a star_args_optional argument for @cmdutils.register as a first step
towards freeing up argument annotations for PEP 484.
See #637.
Under some circumstances I can't reproduce (switching/turning off
monitors?) it seems it's possible that SessionManager.save gets called
with last_window=True, without on_last_window_closed being called.
This might be to one of the Qt screen management bugs fixed in Qt 5.6,
which would explain why I can't reproduce it.
Instead of crashing, let's log the error and not save the session.
There are a lot of problems and flakiness with using a real clipboard.
Instead we now have a :debug-set-fake-clipboard command to set a text, and use
logging when getting the contents.
Fixes#1285.
I tried to set my editor to `termite -e "vim -f {}"`, termite being a
pretty cool and light terminal I use within my i3wm Arch linux box.
So when I open my editor I want it to launch a terminal with Vim inside
instead of GVim for various reasons.
The validation rejected this at first because it was looking for '{}'
inside ['foo', 'bar', 'baz {}'], essentially. So I need it to look
inside the sub-strings, not just the list.
Then after validation I need to perform the '{}' replacement inside the
sub-string too, not just replacing the whole string.
This patch attempts to fix an issue where an error occuring in
misc/guiprocess or the editor process crashing would delete the
temporary file thus making it impossible to recover changes not commited
to the form field from the editor.
This hopefully helps with a crash on Windows which happens from time to time
during some multi-window tabs.feature tests:
Traceback (most recent call last):
File "...\mainwindow\mainwindow.py", line 446, in closeEvent
self._do_close()
File "...\mainwindow\mainwindow.py", line 405, in _do_close
objreg.get('session-manager').save_last_window_session()
File "...\misc\sessions.py", line 247, in save_last_window_session
self._last_window_session = self._save_all()
File "...\misc\sessions.py", line 183, in _save_all
win_data['geometry'] = bytes(main_window.saveGeometry())
RuntimeError: wrapped C/C++ object of type MainWindow has been deleted
If we don't do that, we can get this:
--- Logging error ---
Traceback (most recent call last):
File ".../python3.5/logging/__init__.py", line 984, in emit
self.flush()
File ".../python3.5/logging/__init__.py", line 964, in flush
self.stream.flush()
RuntimeError: reentrant call inside <_io.BufferedWriter name='<stderr>'>
Call stack:
[...]
File ".../qutebrowser/app.py", line 122, in qt_mainloop
return qApp.exec_()
File ".../qutebrowser/utils/objreg.py", line 118, in on_destroyed
log.destroy.debug("schedule removal: {}".format(name))
File ".../python3.5/logging/__init__.py", line 1267, in debug
self._log(DEBUG, msg, args, **kwargs)
File ".../python3.5/logging/__init__.py", line 1415, in _log
self.handle(record)
File ".../python3.5/logging/__init__.py", line 1425, in handle
self.callHandlers(record)
File ".../python3.5/logging/__init__.py", line 1487, in callHandlers
hdlr.handle(record)
File ".../python3.5/logging/__init__.py", line 855, in handle
self.emit(record)
File ".../python3.5/logging/__init__.py", line 984, in emit
self.flush()
File ".../python3.5/logging/__init__.py", line 964, in flush
self.stream.flush()
File ".../qutebrowser/misc/crashsignal.py", line 365, in interrupt
log.destroy.info("Do the same again to forcefully quit.")
Message: 'Do the same again to forcefully quit.'
Arguments: ()