Commit graph

47 commits

Author SHA1 Message Date
Oliver Blanthorn
4e50ab4866
Use definitely typed management types 2021-05-01 14:20:05 +02:00
Oliver Blanthorn
a572575203
Fix mock tests 2020-07-05 21:56:44 +01:00
Oliver Blanthorn
09e19896cf
Grasp the nettle: run prettier on all of src 2020-07-01 18:38:02 +01:00
Oliver Blanthorn
e065c54b76
Swap to DefinitelyTyped types
I was getting fed up with web-ext-types missing some types
2020-07-01 17:37:48 +01:00
Oliver Blanthorn
beebb6ffe5
Re-enable unified-signatures 2020-06-19 13:11:03 +01:00
Oliver Blanthorn
2abb740153
Re-enable array-type 2020-06-18 21:57:16 +01:00
Oliver Blanthorn
7e386f87b8
Re-enable ban-types 2020-06-18 21:55:04 +01:00
Jakub Okoński
5e029c780b Fix type of browserBg and adjust other code for it 2019-10-26 20:07:30 +02:00
Jakub Okoński
ecd3a218aa Clean up toLowerCase unused declaration 2019-10-18 14:57:20 +02:00
Jakub Okoński
0ebc44741b Try a fix for selenium export under the wrong name 2019-10-18 14:11:19 +02:00
Oliver Blanthorn
9ed35ebcf7
Remove no-longer-required fullscreenElement from document for typescript 3.4.x 2019-05-06 21:14:48 +01:00
Saul Reynolds-Haertle
6f726d7092 Teach autocontainers to coexist with other container-management exts
This has a few moving parts.

First, we need a bit of code for keeping track of what other
extensions are installed and enabled. This isn't completely trivial
because we need to listen for "on {en,dis}abled" and "on
{,un}installed" events. This requires a new permission, `management`,
which is _annoying_, but not having this permission would require
extension detection to be done using kludgy messaging hacks that would
be on the critical path for essentially every navigation operation.

Second, we need to write code to talk to the other addons and ask them
if they're handling things. Thankfully they do provide public APIs and
and we can use their sample code to do exactly what we need to do.

Third, it turns out some important chunks of the firefox webext API
aren't handled by the web-ext-browser ts declaration we're
using. They *are* handled by a PR on @types/firefox-webext-browser,
though, so we can copy and paste that to make TS happy.

Fourth, and finally, we need to add some code to the autocontainer
logic to use the compatibility code. This is pretty easy, but
autocontainer logic starts taking a noticeable amount of time becuase
of all the sequences awaits we're doing, so I also have to tweak
things to do all of the async stuff in parallel.
2019-04-16 22:59:30 -07:00
glacambre
ea257f3644
Add searchengine support
This commit adds searchengine support to tridactyl. Avoiding code
duplication between open and tabopen required changing the way tabopen
works: first, it opens a new tab pointing to Tridactyl's newtab page and
only after that does it actually navigate to where the user wants.
2019-01-27 13:04:51 +01:00
Oliver Blanthorn
2ee47a9941
Merge branch 'master' into make_find_faster
Rebases are for people who understand how git works.
2019-01-15 17:09:16 +00:00
Oliver Blanthorn
d385e65a76
Update dependencies
Add focus signature with no argument and Document.fullscreenElement to Document interface.

Add sloppy typing to fuseOptions.
2018-11-05 13:12:08 +00:00
Saul Reynolds-Haertle
b8e0459e6b Build a performance counters system so I can start optimizing things
Complete a circular buffer so we don't log too much data, config
settings for turning it on and off (default off, becuase performance)
and for changing the size of the buffer, an excmd for dumping the raw
json so you can pore over it, and for when you just want to
sanity-check yourself instead of groveling over your data for six days
with a deep learning toolkit and three hundred CPUs of compute, an
excmd for pretty-printing your stats in a nice histogram.

I didn't think far enough ahead and only implemented the easy way to
instrument a function, which is with a decorator. I'm getting _really_
angry at typescript not being able to handle decorators on free
functions. bah. I'll figure out a good way to wrap free
functions. Maybe just go the stupid route and make you change
`export async function foo(args)` to `export foo = measured(async
function(args) ...`. But that would break excmd parsing, so... :/

I think that I already want to do a refactor to break excmd.ts into a
bunch of one-line wrappers referencing implementations spread
throughout a bunch of libraries. This would go nicely with that.

Other things I did while I was here:
* Fix the ugliness we had with (window as any).tri by monkey-patching
  the tri property into the window object in tridactyl.d.ts
2018-09-30 12:01:07 -07:00
glacambre
b8f7d5f389
Find.ts: Implement :find, :findnext 2018-06-24 13:36:06 +02:00
glacambre
be8251d3b8
tridactyl.d.ts: Add pageX and pageY to UIEvent interface 2018-05-27 09:02:30 +02:00
Colin Caine
a883c9ebee Stop typedoc complaining about toBeAll 2018-05-21 01:22:04 +01:00
Anton Vilhelm Ásgeirsson
3fe0f5e1e9
Bypass CSP
Allows Tridactyl to run on places such as raw.github* until Mozilla fix
issue https://bugzilla.mozilla.org/show_bug.cgi?id=1267027.
2018-05-08 18:07:14 +01:00
glacambre
34d8363224
tridactyl.d.ts: Add focus with arguments to HTMLElement interface 2018-04-14 11:05:40 +02:00
Oliver Blanthorn
095ce771ea
Formatting: run all typescript through prettier 2018-04-13 19:28:03 +01:00
glacambre
572b341068
src/tridactyl.d.ts: Add window.eval and exportFunction definitions 2018-03-03 14:19:58 +01:00
Colin Caine
3cae9a5334 Revert "excmd: fix :version"
This reverts commit baa5a9b861.
2017-11-28 17:23:16 +00:00
Colin Caine
baa5a9b861 excmd: fix :version 2017-11-28 16:05:08 +00:00
Colin Caine
ec01dadf27 completions: add fuse.js and html-tagged-template 2017-11-22 21:30:36 +00:00
Adam Plaice
895cfc6291 Add reader excmd (toggle reader mode)
It is already bound to "gr".

Unless and until the keyboard api is ready or Firefox allows
webextensions to inject scripts into the very security-sensitive
about:reader context, this will only switch on reader mode. One
can get out of reader mode, by pressing <Alt-←>.

Once one of the above conditions is met, the toggling should work
without any further changes.
2017-11-21 21:13:11 +00:00
Oliver Blanthorn
9a4c4545aa
Improve zoom type checking (thanks @aplaice!) 2017-11-21 21:07:35 +00:00
Oliver Blanthorn
85d6eba2b5
Revert "Merge branch 'Koushien-completions'"
This reverts commit 0aa14bb754, reversing
changes made to eae9cd0dab.
2017-11-21 20:28:48 +00:00
Colin Caine
1045eadc0e completions: WIP 2017-11-21 05:15:52 +00:00
Colin Caine
e55d174747 completions: add fuse.js and html-tagged-template 2017-11-21 05:15:52 +00:00
Oliver Blanthorn
fc9b34d08c
Add zoom command 2017-11-15 12:40:26 +00:00
Colin Caine
adfca7cf69 hinting WIP: plumb to background 2017-11-09 05:44:40 +00:00
Colin Caine
446bd0be21 messaging: move more modules to new sys 2017-10-28 05:11:10 +01: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
Colin Caine
6185805d42 tsc: move browser.sessions definitions to web-ext-types
excmds.ts had to change so that anonymous func returns bool
2017-10-22 17:03:23 +01:00
Andrzej Pacanowski
b78be56273 enhance :undo logic
restore most recently closed tab in this window unless the most recently closed item was a window
2017-10-22 00:38:49 +01:00
Colin Caine
8897d8929b excmds: Macro-ify excmds_background and content
excmds_background/content are now generated by python. New dependency,
python3!
2017-10-19 04:40:36 +01:00
Oliver Blanthorn
fa51fc2024
Add tabdetach,duplicate and undo commands; fix multi-window bugs 2017-10-16 14:42:12 +01:00
Oliver Blanthorn
ea9806f591
Add proof of concept for buffer filter by text on page 2017-10-15 23:05:41 +01:00
Koushien
9b42a437d9
Compress scrolls, scrollto accept %
Implement Number.clamp to help scrollto
2017-10-06 19:31:10 -07:00
Colin Caine
df3ca534ed src: fix commandline_frame/background messaging
The commandline iframe needs to be messaged with the tabs API, as if
it's a content script.
2017-10-06 04:16:02 +01:00
Colin Caine
bed1109cc9 types: extend type checking 2017-10-06 03:30:51 +01:00
Colin Caine
5964430fe1 Convert to es6 modules
Motivation:

 - Most test frameworks expect modules
 - I'm told they're the future

Changes:

 - Every typescript source file is now an es6 module
 - Build system is now webpack (tho rollup makes nicer outputs)
 - Outputs of buildsystem are one js file per entry point (background,
   content, commandline_frame)
 - These bundled js files are generated by traversing the dependency
   graph of each entry point
2017-10-02 01:17:32 +01:00
Colin Caine
1204206f02 Document interfaces better 2017-09-28 22:39:26 +01:00
Koushien
687aaf9209
Implement different scroll excmds
In addition to scrollByLine and scrollByPage,
an excmd to scroll by half pages is included to
mimic default <C-u> and <C-d> behavior. In a
future revision, it may be preferred to have some
variable V for scroll values that pulls current
window height when called.
2017-09-27 21:10:52 -07:00
Colin Caine
9e57a25aa6 Proof of concept
keyboard API shim written, parser revised, example scrolling excmds
implemented.
2017-09-25 05:00:41 +01:00