Commit Graph

9373 Commits

Author SHA1 Message Date
Florian Bruhin
6f074049c2 Update docs 2016-08-09 16:14:58 +02:00
Florian Bruhin
13f80e3f63 Merge branch 'hintmodes' of https://github.com/haasn/qutebrowser into haasn-hintmodes 2016-08-09 16:14:07 +02:00
Florian Bruhin
fefea4944a QtWebEngine: Make :open-editor work 2016-08-09 16:00:59 +02:00
Florian Bruhin
ca67e2be3c QtWebEngine js: Get rid of webelem.get_element()
Let's do separate JS functions instead so we can easily access them via
utils.javascript.assemble.
2016-08-09 16:00:20 +02:00
Florian Bruhin
1e5b6caa4b QtWebEngine js: Save element in focus_element() 2016-08-09 15:59:57 +02:00
Niklas Haas
62e58c0ab9
Add a --mode flag to :hints
This allows a specific keybinding, for whatever reason, to override the
default mode. Examples of when this could be useful:

* :hint --rapid --mode=word  (to type them more rapidly)
* :hint --mode=letter input  (if the default mode is number)

Also reword the description of 'group' to make the distinction between
'group' and 'mode' clearer.
2016-08-09 15:34:13 +02:00
Florian Bruhin
9f770adc78 Lower-case WebEngineElement.tag_name() correctly 2016-08-09 15:19:57 +02:00
Florian Bruhin
2d48a8013f tests: Don't set ssl-strict with QtWebEngine 2016-08-09 15:13:26 +02:00
Florian Bruhin
c8d39e8934 tox: Fix vulture environment
We set PYTHONPATH so we can import qutebrowser.app in run_vulture.py
without installing it.

We also need to make sure all dependencies are installed so we can
actually import qutebrowser.
2016-08-09 13:54:54 +02:00
Florian Bruhin
c0a407235c Remove unused import 2016-08-09 13:51:18 +02:00
Florian Bruhin
74b279e5a9 Adjust .eslint* paths in MANIFEST.in 2016-08-09 13:38:55 +02:00
Florian Bruhin
b82823d76a js: Don't leak to global ns in position_caret.js 2016-08-09 13:36:46 +02:00
Florian Bruhin
c8a92a0851 Fix test_assemble 2016-08-09 13:23:46 +02:00
Florian Bruhin
1307d8e9a2 Simplify utils.javascript.assemble 2016-08-09 13:21:44 +02:00
Florian Bruhin
4046615b37 WebEngineScroller: Set position to (0,0) initially
Since we now use QWebEngineScript, we can't easily know when the script
finished running and we can access window._qutebrowser.scroll.

We instead assume the initial position (if we don't get a
scrollPositionChanged) will always be (0, 0), and explicitly set it
to (None, None) (displaying ???) if we can't connect that signal.
2016-08-09 13:18:33 +02:00
Florian Bruhin
6b7a39685e Modularize javascript code
We now load the JS code as a QWebEngineScript, which sets up
window._qutebrowser with various "modules". That means we don't have to
pass the whole module every time we want to execute something.
2016-08-09 13:17:44 +02:00
Florian Bruhin
00673ef7da tox: Only install pip as dep when needed
misc/eslint don't actually install anything, so no point in updating pip
there.

pyroma/check-manifest should install pip though.
2016-08-09 11:10:50 +02:00
Florian Bruhin
a4585bb3d5 tox: Don't install any deps for eslint 2016-08-09 11:09:15 +02:00
Florian Bruhin
2a2c49f507 tox: Set skipsdist = true
Since our tests don't actually run against the installed package, no
point in waiting for an sdist to be built.
2016-08-09 11:08:19 +02:00
Florian Bruhin
5a1910e24d tox: Enforce colors for eslint 2016-08-09 11:05:08 +02:00
Florian Bruhin
1d9113124b Move .eslintrc to qutebrowser/javascript 2016-08-09 11:04:50 +02:00
Florian Bruhin
4da53480c2 Re-enable and reconfigure eslint 2016-08-09 11:00:26 +02:00
Florian Bruhin
80016006c4 Use and enforce "use strict"; for JS 2016-08-09 09:55:14 +02:00
Florian Bruhin
686d49b578 Merge branch 'haasn-hinttags' 2016-08-09 08:43:47 +02:00
Florian Bruhin
998a4d8fc3 Regenerate authors 2016-08-09 08:43:40 +02:00
Florian Bruhin
c3690bce0d Merge branch 'hinttags' of https://github.com/haasn/qutebrowser into haasn-hinttags 2016-08-09 08:43:32 +02:00
Florian Bruhin
ee24bdb1c8 flake8 requirements: Update pyparsing to 2.1.6
- *Major packrat upgrade*, inspired by patch provided by Tal Einat -
  many, many, thanks to Tal for working on this! Tal's tests show
  faster parsing performance (2X in some tests), *and* memory reduction
  from 3GB down to ~100MB! Requires no changes to existing code using
  packratting. (Uses OrderedDict, available in Python 2.7 and later.
  For Python 2.6 users, will attempt to import from ordereddict
  backport. If not present, will implement pure-Python Fifo dict.)

- Minor API change - to better distinguish between the flexible
  numeric types defined in pyparsing_common, I've changed "numeric"
  (which parsed numbers of different types and returned int for ints,
  float for floats, etc.) and "number" (which parsed numbers of int
  or float type, and returned all floats) to "number" and "fnumber"
  respectively. I hope the "f" prefix of "fnumber" will be a better
  indicator of its internal conversion of parsed values to floats,
  while the generic "number" is similar to the flexible number syntax
  in other languages. Also fixed a bug in pyparsing_common.numeric
  (now renamed to pyparsing_common.number), integers were parsed and
  returned as floats instead of being retained as ints.

- Fixed bug in upcaseTokens and downcaseTokens introduced in 2.1.5,
  when the parse action was used in conjunction with results names.
  Reported by Steven Arcangeli from the dql project, thanks for your
  patience, Steven!

- Major change to docs! After seeing some comments on reddit about
  general issue with docs of Python modules, and thinking that I'm a
  little overdue in doing some doc tuneup on pyparsing, I decided to
  following the suggestions of the redditor and add more inline examples
  to the pyparsing reference documentation. I hope this addition
  will clarify some of the more common questions people have, especially
  when first starting with pyparsing/Python.

- Deprecated ParseResults.asXML. I've never been too happy with this
  method, and it usually forces some unnatural code in the parsers in
  order to get decent tag names. The amount of guesswork that asXML
  has to do to try to match names with values should have been a red
  flag from day one. If you are using asXML, you will need to implement
  your own ParseResults->XML serialization. Or consider migrating to
  a more current format such as JSON (which is very easy to do:
  results_as_json = json.dumps(parse_result.asDict()) Hopefully, when
  I remove this code in a future version, I'll also be able to simplify
  some of the craziness in ParseResults, which IIRC was only there to try
  to make asXML work.

- Updated traceParseAction parse action decorator to show the repr
  of the input and output tokens, instead of the str format, since
  str has been simplified to just show the token list content.

  (The change to ParseResults.__str__ occurred in pyparsing 2.0.4, but
  it seems that didn't make it into the release notes - sorry! Too
  many users, especially beginners, were confused by the
  "([token_list], {names_dict})" str format for ParseResults, thinking
  they were getting a tuple containing a list and a dict. The full form
  can be seen if using repr().)

  For tracing tokens in and out of parse actions, the more complete
  repr form provides important information when debugging parse actions.
2016-08-08 23:54:42 +02:00
Florian Bruhin
2aa5804418 requirements: Update requests to 2.11.0
Improvements

- Added support for the ALL_PROXY environment variable.
- Reject header values that contain leading whitespace or newline characters to
  reduce risk of header smuggling.

Bugfixes

- Fixed occasional TypeError when attempting to decode a JSON response that
  occurred in an error case. Now correctly returns a ValueError.
- Requests would incorrectly ignore a non-CIDR IP address in the NO_PROXY
  environment variables: Requests now treats it as a specific IP.
- Fixed a bug when sending JSON data that could cause us to encounter obscure
  OpenSSL errors in certain network conditions (yes, really).
- Added type checks to ensure that iter_content only accepts integers and None
  for chunk sizes.
- Fixed issue where responses whose body had not been fully consumed would have
  the underlying connection closed but not returned to the connection pool,
  which could cause Requests to hang in situations where the HTTPAdapter had
  been configured to use a blocking connection pool.

Miscellaneous

- Updated bundled urllib3 to 1.16.
- Some previous releases accidentally accepted integers as acceptable header
  values. This release does not.
2016-08-08 23:52:49 +02:00
Florian Bruhin
ec21041516 Add a warning header to commands/settings.asciidoc
See #1802
2016-08-08 22:54:07 +02:00
Florian Bruhin
5668a5e71a Merge branch 'addictedtoflames-patch-1' 2016-08-08 19:56:34 +02:00
Florian Bruhin
e97765c1c5 Regenerate docs 2016-08-08 19:56:24 +02:00
Florian Bruhin
9fc44e54a4 Fix long line 2016-08-08 19:56:11 +02:00
addictedtoflames
b750d93891 add time units to timeout descriptions
Changed the description for the 'hints/auto-follow-timeout', 'input/timeout' and 'input/partial-timeout' settings to specify that the time should be given in milliseconds
2016-08-08 17:32:41 +01:00
Niklas Haas
6e279f1b1e
Extract hint tags from <button> text
This is useful for some styled buttons, including some of those found on
GitHub.
2016-08-08 17:49:35 +02:00
Niklas Haas
cf26201e86 Extract hint tags from <input placeholder="text">
This is useful for very many input fields, especially prominent on
GitHub itself.
2016-08-08 17:49:18 +02:00
Florian Bruhin
af8302b678 Remove unused import 2016-08-08 16:32:23 +02:00
Florian Bruhin
9a17591fb7 Start getting :open-editor to work with WebEngine
It doesn't actually work yet (as it claims the field is not editable),
but at least does not crash when the backend limitation for the command
is removed.
2016-08-08 16:24:34 +02:00
Florian Bruhin
58fb41ab9d tests: Fix webkitelem test for tagName 2016-08-08 15:34:45 +02:00
Florian Bruhin
8187a334f7 Merge branch 'rcorre-completion-item-focus' 2016-08-08 15:23:08 +02:00
Florian Bruhin
7c689d83bf Update docs 2016-08-08 15:22:57 +02:00
Florian Bruhin
9d43becc25 Merge branch 'completion-item-focus' of https://github.com/rcorre/qutebrowser into rcorre-completion-item-focus 2016-08-08 15:21:35 +02:00
Florian Bruhin
ded2143761 test requirements: Update pytest-cov to 2.3.1
- Fixed regression causing spurious errors when xdist was used.
- Fixed DeprecationWarning about incorrect addoption use.
- Fixed deprecated use of funcarg fixture API.
2016-08-08 15:20:04 +02:00
Florian Bruhin
3c573ac187 Fix upper-case tag names for WordHinter 2016-08-08 15:13:30 +02:00
Florian Bruhin
b8e2d5f8f6 Add initial WebEngineElement implementation
This allows :navigate prev/next to work correctly via the javascript
bridge.
2016-08-08 15:02:58 +02:00
Florian Bruhin
1c73751fd9 Always lowercase tagName 2016-08-08 14:11:01 +02:00
Florian Bruhin
9bcce37ff3 WebEngine: Allow :navigate up/decrement/increment 2016-08-08 14:09:28 +02:00
Florian Bruhin
0b16a36120 Clean up handling of focus element
Also fixes #1359.
2016-08-08 14:05:30 +02:00
Florian Bruhin
27330bd4d1 Fix :search-prev with QtWebEngine
Fixes #1797
2016-08-08 13:51:42 +02:00
Florian Bruhin
92049155af Whoops... 2016-08-08 13:42:37 +02:00
Ryan Roden-Corrent
7038db6b17 Combine completion-item-{prev,next}.
- Use a single command completion-item-focus with a next/prev argument.
- Add a rule to translate old configs.
- Regenerate the docs.

See #1095.
2016-08-08 07:37:53 -04:00