I thought I put this in here before, but apparently I did not. So here it is,
together with a new test to verify it. Other tests needed to be updated with a
mock for os.path.expandvars.
In function File.validate the try-except block has been re-written to
differentiate raised errors.
In function File.transform there was a check for validity of the file path that
is alraedy performed by File.validate under the same conditions. This check has
been removed.
Error messages for validate() are more specific.
Return of standarddir.conf() is explicitly tested for None to avoid ambiguity
with other falsey values.
... As I want to copy only the domain fairly frequently.
I also changed the message in the statusline to show the actual text being
copied, which I find helpful. But if you disagree, then just undo it (it's not
that important or anything).
This sets the third-party cookie policy.
- I created a new ThirdPartyCookiePolicy() class, since this setting seems to be
unique in the way it is set...
- I set the default to 'never', which is the most secure/private setting, but
*may* break *some* features of a (very) limited number of sites; these are
usually "non-critical" features.
For example, on Stack Exchange sites you're logged in all 200+ sites if you
sign in on one of them, this features required 3rd party cookies. You can
still sign in with out, but you have to do so 200+ times (this is actually the
only example I've ever noticed).
AFAIK all "major" browsers accept 3rd-party cookies by default, except for
Safari. Firefox also made this change, but reversed it (see:
https://brendaneich.com/2013/05/c-is-for-cookie/), but they don't offer any
good arguments to *not* have it IMHO, at least not that I could find.
In any case, in my humble opinion "secure and private by default" is the best
way to ship. But you're of course free to change it if you disagree ;-)
There were no tests regarding the return value of standarddir.config() and thus
it wasn't caught that it returned None in some cases. This is now fixed by
checking the return of standdarddir.config before calling it and modifying the
corresponding test_validate_exists_rel as well as adding a new
test_validate_rel_config_none.
In UserStyleSheet.transform os.path.isabs was replaced with os.path.exists, a
more fitting condition. Accordingly two test cases needed to include mocks for
os.path.exists and QUrl.fromLocalFile.
The code from function validate in class UserStyleSheet has been migrated to
class File. One test had to be modified due to different expected behaviour.
My logic in the validate function of class UserStyleSheet was faulty and
caused the check for encoding to be skipped. This is now fixed and all
tests run successfully.
Function transform is not supposed to raise exceptions, so I wrapped the
call to os.path.join in an if-clause to test if standarddir.config
returns a valid value.
The last commit removed two lines in function validate of class
UserStyleSheet that were expanding the path. As it turns out those two
lines are needed by validate as well as transform, so I outsourced them
to the function they both call at that point.
The former version of UserStyleSheet never actually loaded the css file,
this is now fixed. The changes to class File were rolled back as its
functions are overloaded by UserStyleSheet; a general solution in
classes File and Directory can be implemented when the changes in
UserStyleSheet meet the expectation.
This ist just a first draft to approach issue622
(https://github.com/The-Compiler/qutebrowser/issues/622) and my very
first babysteps with python.
With this change it is possible to set a user-stylesheet with a relative
path, eg.:
:set ui user-stylesheet mystyle.css
where mystyle.css is in the ~/.config/qutebrowser/.
When trying to add a new binding with multiple values, the bindings were added
immediately and the next _is_new() check returned False because the command was
already bound.
With this change, the new bindings first get added to a temporary dict so
_is_new() returns the correct result.
See #653.
When trying to add a new binding with multiple values, the bindings were added
immediately and the next _is_new() check returned False because the command was
already bound.
With this change, the new bindings first get added to a temporary dict so
_is_new() returns the correct result.
See #653.
Added option to webview for selection enabled caret mode.
In status bar checking value of this option to identificate about it.
Added bindings: <Space> for toggle selection mode, <Ctrl+Space> drop
selection and keep selection mode enabled.
In webview added javascript snippet to position caret at top of the
viewport after caret enabling. This code mostly was taken from cVim sources.
When a default keybinding is unbound it'd get readded, so we add a new special
<unbound> "command" to the config, and keys listed there won't get rebound
automatically.
Also, :unbind now maps the key to <unbound> if it exists in the default config.
See #525.
When we have something like ":bind x foo;;bar" it wasn't recognized "bind" is a
no_cmd_split command because we tried to look up "bind x foo" in cmd_dict.
See #615.
Allow user switch in caret mode for browsing with caret, and visual mode
for select and yank text with keyboard.
Default keybindings is c or v for caret mode, and again v for visual mode. All
basic movements provided by WebAction enum implemened with vim-like
bindings. Yanking with y and Y for selection and clipboard respectively.
There is bug/feature in WebKit that after caret enabled, caret doesn't
show until mouse click (or sometimes Tab helps). So I add some workaround
for that with mouse event. I think should be better aproach.
Signed-off-by: Artur Shaik <ashaihullin@gmail.com>
Before, configdata.DATA only existed once - that means when something
manipulated it, instantiating a new ConfigManager actually gave us the
*modified* rather than the default data.
There's still a (now readonly) configdata.DATA for performance reasons -
before, the settings completion model called data() many times, which caused
initializing of it taking a few (instead of nearly 0) seconds.
See https://github.com/hackebrot/qutebrowser/pull/16#discussion-diff-27770433
Before, we used the 'changed' signal for the SaveManager - however, that also
was emitted when only the internal structure changed. Now we add a new signal
for that.
If an user e.g. has a download-directory of ~/föö, but has LC_ALL=C set, we'll
get an UnicodeEncodeError when trying to validate it. This is now handled
properly by raising a ValidationError.
Fixes#562.
This makes qutebrowser.config.websettings much easier to understand, and saves
all defaults so it can restore them properly when a setting is set to an empty
string.
Before, when we set the fonts to empty strings instead of the true default, in
some cases anti-aliasing was broken.
Fixes#549.
This is enabled by default to keep the same default behaviour which is like
Vimium - mixing e.g. single-char letters and double-char letters, and
scattering/shuffling the labels to have an uniform hint key distribution.
If disabled, the behaviour is more similiar to dwb, which has a fixed hint
string length and simply fills the string starting with the first possible hint
char.
We already attempted this in c5a2039da4, but
having the directories as module attributes means they'll be created on start
(rather than when they're actually used), and it'd also be impossible to change
them after init for some reason in the future.
To still have a nice short API, we simply change the attributes to functions.
QWebInspector uses QSettings to save its GUI-settings. However, the default
path for QSettings is ~/.config/qutebrowser/qutebrowser.conf which overwrites
our own config file.
This fixes one part of #515.
Closes#12.
See #499.
See #11.
This adds PyYAML as a new dependency.
It adds the following new commands:
:session-delete <name>
Delete a session.
:session-load <name>
Load a session.
:session-save [<name>]
Save a session.
:wq [<name>]
Save open pages and quit.
And the following new settings:
general -> save-session:
Whether to always save the open pages.