tridactyl/src/content.ts
Koushien f982233a49 completions: initial implementation
This commit squashes a load of work by @Koushien, a dozen hours from
@cmcaine and some CSS by @bovine3dom.

@cmcaine is writing this commit message, but the work was mostly by
Koushien so the author is set to them. Thanks Koushien!

The following issues need to be fixed:

 - The interface is over complicated (my fault)
 - commandline_frame is hard-coded to use BufferCompletionSource. This
   needs to be made more general
 - BufferCompletionSource should be generalised
 - completions.ts calls helper functions in commandline_frame. Should
   just use browser proxy. If that's too slow can define a
   completions_background.ts

After that's done, this should be fixed:

 - Completion hiding/unhiding is currently too messy.
2017-11-22 21:30:37 +00:00

41 lines
1.2 KiB
TypeScript

/** Content script entry point */
// Be careful: typescript elides imports that appear not to be used if they're
// assigned to a name. If you want an import just for its side effects, make
// sure you import it like this:
import "./lib/html-tagged-template"
/* import "./keydown_content" */
/* import "./commandline_content" */
/* import "./excmds_content" */
/* import "./hinting" */
console.log("Tridactyl content script loaded, boss!")
// Add various useful modules to the window for debugging
import * as commandline_content from './commandline_content'
import * as convert from './convert'
import * as dom from './dom'
import * as excmds from './excmds_content'
import * as hinting_content from './hinting'
import * as itertools from './itertools'
import * as keydown_content from "./keydown_content"
import * as messaging from './messaging'
import * as msgsafe from './msgsafe'
import state from './state'
import * as webext from './lib/webext'
(window as any).tri = Object.assign(Object.create(null), {
browserBg: webext.browserBg,
commandline_content,
convert,
dom,
excmds,
hinting_content,
itertools,
keydown_content,
messaging,
msgsafe,
state,
webext,
l: prom => prom.then(console.log).catch(console.error),
})