Commit graph

30 commits

Author SHA1 Message Date
Oliver Blanthorn
e4cca9318b
Merge branch 'master' of github.com:cmcaine/tridactyl into glacambre-fix_#471 2018-06-14 12:48:34 +01:00
glacambre
acc78b74ca
dom.ts: Fix error when focusing email input elements 2018-06-05 22:13:07 +02:00
glacambre
d0df64ad15
{excmds,dom}.ts: Fix external editor updating the wrong field 2018-06-04 07:10:23 +02:00
Colin Caine
2557b32b20 Revert "Add appendTo()"
This reverts commit 71d27e5133.
2018-05-21 11:06:12 +01:00
Colin Caine
71d27e5133 Add appendTo()
Appends an element as a child of another if it can, else waits for
DOMContentLoaded.

Cleans up modeindicator insertion a bit.
2018-05-20 17:54:29 +01:00
Colin Caine
d36757cbc8 Fix <C-i> on contenteditable elements 2018-05-17 21:42:47 +01:00
Oliver Blanthorn
47409e4fd2
Make Logging.Logger.error print an error to the command line 2018-04-23 15:09:20 +01:00
Oliver Blanthorn
bcbbbe6607
Remove errant log. 2018-04-20 17:15:55 +01:00
Oliver Blanthorn
4e77b65123
Add jumplist for inputs bound to g;
Currently repeated use of `g;` will only take you to the most recently
used input. Cycling through recently used inputs is a WIP.
2018-04-20 17:05:15 +01:00
glacambre
cfb6484f30
{config,dom}.ts: Turn 'allowautofocus' setting into a string 2018-04-14 11:12:12 +02:00
glacambre
0e128b9ef8
{config,content,dom,excmds}.ts: Implement autofocus-prevention mechanism 2018-04-14 11:10:42 +02:00
Oliver Blanthorn
095ce771ea
Formatting: run all typescript through prettier 2018-04-13 19:28:03 +01:00
Oliver Blanthorn
37b9faab9f
Fix build warnings 2018-04-13 09:39:43 +01:00
glacambre
9fdbbd435a
dom.ts: Handle errors thrown by CSP in getAllDocumentFrames() 2018-04-13 07:18:42 +02:00
glacambre
f7c4007e53
dom.ts: Fix typing error 2018-04-02 19:15:38 +02:00
glacambre
e59dde5a0f
{dom,hinting}.ts: Add elements located in iframes to hintable elements 2018-04-02 19:15:29 +02:00
glacambre
ce7be35e73
{config,dom}.ts: Implement focus() which moves to end of focused inputs 2018-04-02 14:53:09 +02:00
Colin Caine
355f018b5f
dom.ts: Modify security check, comments 2018-03-03 14:20:09 +01:00
glacambre
f584c67f16
src/{content,dom,hinting}.ts: Implement addEventListener hijacking
This commit makes Tridactyl aware of elements made interactive through
JavaScript and lets Tridactyl put hints on them.
Something possibly dangerous is done here: exporting a function to the
page's context. While it is believed that the current implementation is
secure and that pages can't discover whether the function has been
exported or not, this might change due to new standards being adopted by
firefox. One of these standards is the Custom Elements api:
https://developer.mozilla.org/en-US/docs/Web/Web_Components/Custom_Elements

It will be necessary to check how Tridactyl behaves once this API has
landed. The status of this API seems to be tracked here:
https://bugzilla.mozilla.org/show_bug.cgi?id=1406825
2018-03-03 14:20:06 +01:00
glacambre
a4a3d4feb5
src/dom.ts: Add click events when tridactyl sends hover events. 2018-03-03 14:20:02 +01:00
Oliver Blanthorn
3ccd330a89
Merge pull request #284 from Koushien/dropdown
Unless cancelled, insert mode when select tag focused
2018-01-25 09:37:16 +00:00
John Beard
de94ac5007 Case insensitive isEditable check on tag names
Previously was a case-sensitive check against an uppercase name. This
works for HTML.

XHTML will be whatever the source document is, which could be upper or
lower. Firefox will render either one the same, but only uppercase will
be deemed editable by Tridactyl. Fix this by doing a case-insensitive
comparision.

Tag casing is described in:
https://developer.mozilla.org/en-US/docs/Web/API/Element/tagName

Thanks Koushien for working this one out!
2018-01-21 17:36:00 +00:00
Koushien
104e1a98f3
Unless cancelled, insert mode on select tag focus
Added case to nodeName switch; handles basic
dropdown menus.
2018-01-20 17:17:14 -08:00
Oliver Blanthorn
d9fc24dc62
Merge branch 'master' of github.com:cmcaine/tridactyl into glacambre-fix_pcgamer_hints 2017-11-30 08:58:45 +00:00
glacambre
24632c8dfb src/dom.ts: Fix hints not being displayed on certain sites.
Problem: Hints aren't displayed for certain elements. This was because
the isVisible function didn't pay attention to the element's 'display'
attribute when deciding whether an element is visible according to its
height/width.

Solution: Add two functions to help decide whether the height and width
attribute of an element matter.

Note: The two functions do not do anything if an element's 'display'
attribute is set to either 'initial' or 'inherit' because taking these
into account seems complicated.

Fixes issue https://github.com/cmcaine/tridactyl/issues/127 .
2017-11-30 05:47:18 +01:00
John Beard
f0dfe1d5da Refactor document CSS selector queries with dom.ts
The DOM.getElemsBySelector function makes it a bit less verbose to
construct an array of filtered elements matching a selector.

Also, this function is expanded to take multiple filters, applied
sequentially.
2017-11-29 02:27:49 +00:00
John Beard
6a48990751 Add focusinput command (gi)
Can focus the nth input from the start or end of a page.

Also has some special modes:

  -l: last focussed input
  -p: first password input
  -b: the largest input by area
2017-11-25 01:41:38 +00:00
Colin Caine
927e19c818 hinting: First working version
state.ts also reworked into a sexy new machine. Check it out!
2017-11-09 05:44:48 +00:00
Colin Caine
adfca7cf69 hinting WIP: plumb to background 2017-11-09 05:44:40 +00:00
Colin Caine
8d53fd60eb Rework messaging, key suppression, exmode parser
exmode.parser now converts strings to the types given in excmd
signatures.

Messaging now works in both directions (but I haven't made excmds.ts use
the new system yet. Exercise for the reader (see keydown_* state() for a
simple example)).

keys are now being suppressed, but in a pretty stupid way.

I got fed up of not having proper itertools, or str conversions, so I
wrote some. Others have written them in JS, but they were fun to make.
Only the ones I'm using are tested.
2017-10-23 09:42:50 +01:00