Commit graph

2240 commits

Author SHA1 Message Date
glacambre
2b44d73ac9
Turn noiframeon setting into a site-specific setting
As discussed on riot, turning noiframeon into a site-specific setting
is a good thing for consistency. This commit also adds a deprecation
warning when users try to `:set noiframeon` and updates the
troubleshooting guide.
2018-11-28 07:58:46 +01:00
glacambre
3f6dee0342
commandline_content.ts: Move try/catch out of init() function
The try/catch in init() prevents errors from bubbling up and thus
also prevents the document.addEventListener("DOMContentLoaded", init)
call from being performed. We fix this by removing the try/catch from
init() and adding a new one in the document.addEventListener call.
2018-11-28 07:07:41 +01:00
Oliver Blanthorn
d2e71aaf92
Merge pull request #1198 from glacambre/various_fixes
Various fixes
2018-11-27 19:32:25 +00:00
glacambre
a1d20057f9
config.ts: Fix getURL returning {} for keys that do not exist
https://github.com/tridactyl/tridactyl/pull/1194 introduced a huge bug.
Config.get relies on config.getURL returning undefined when a target
doesn't exist for a url in order to know whether it should return the
default value or not. However, #1194 accidentally made getURL return
empty objects for every target that does not have a url-specific
setting.

This commit fixes that and maybe
https://github.com/tridactyl/tridactyl/issues/1197, although I am not
100% sure.
2018-11-27 19:05:04 +01:00
glacambre
9d11aeaf9b
build.sh: Replace [[ with [
[[ is a bashism and is not defined in posix sh. Since the shebang is
 #!/bin/sh, the build script is executed with posix sh and this caused
error messages to be printed when building.
[[ couldn't just be replaced with [ because [ doesn't allow matching
globs, so a switch/case was used instead.
2018-11-27 18:47:58 +01:00
Oliver Blanthorn
6cd0a1deea
Remove indirect event-stream dependency
See https://github.com/dominictarr/event-stream/issues/116
2018-11-26 19:54:34 +00:00
Oliver Blanthorn
cd2f964136
Merge pull request #1194 from glacambre/fix_1193
config.ts: Fix getURL not merging site-specific config objects
2018-11-26 11:57:05 +00:00
Oliver Blanthorn
cbfcf94c45
Merge pull request #1195 from keegancsmith/mac
scripts: Use different flags for sed and base64 on Mac
2018-11-26 11:54:49 +00:00
Keegan Carruthers-Smith
74a52a61eb scripts: Use different flags for sed and base64 on Mac
sed and base64 have different flags on darwin (and possibly other
BSDs). Alternatively we could encourage the user to install coreutils and use
gsed and gbase64.
2018-11-26 11:45:48 +02:00
glacambre
57afbfedac
config.ts: Fix getURL not merging site-specific config objects
https://github.com/tridactyl/tridactyl/issues/1193 happened because
before this commit, getURL did not merge objects from different
site-specific configs. This means that if a user had the following site
specific configs:

"example": {
        "priority": 1,
        "nmaps": {
                "a": "js alert('')"
        },
}
"example.org": {
        "priority": 2,
        "nmaps": {}
}

A call to config.getURL("example.org", ["nmaps"]) resulted in the empty
object from the "example.org" config being returned and the mappings for
"example" to be ignored. This obviously is not the desired behavior.

This is fixed by mergeDeep()'ing objects found in matching site-specific
configs.

Closes #1193.
2018-11-25 19:06:17 +01:00
glacambre
47c0fcc16a
config.ts: Hide internal functions 2018-11-24 14:01:42 +01:00
glacambre
51b4480b3f
Replace browser.storage.onChanged with config.addChangeListener
This commit replaces the use of browser.storage.onChanged.addListener
with the newly-implemented config.addChangeListener.
2018-11-23 22:42:52 +01:00
glacambre
a1d55df6bc
config.ts: improve addChangeListener handling of objects
This commit prevents triggering of event listeners when values that
aren't set in USERCONFIG are set to the value they have in
default_config.

Also, before this commit, listeners added to setting objects (e.g.
`nmaps`) with addChangeListener would always be triggered, even if the
new object was structurally equivalent to the previous one. This commit
stringifies both object in order to perform comparisons, this prevents
this case from happening.

Note that there's still a problem with the way objects are handled: when
setting the key of an object (e.g. `nmaps.j`), eventListeners set on the
object (`nmaps`) will be triggered even if no user-facing change happens
(e.g. the user set `nmaps.j` to whatever value `nmaps.j` already had in
default_config). This is because the user config is actually the result
of a merge between the default config and their custom config, but the
event listener code performs no such merges for simplicity's sake.
2018-11-23 22:24:14 +01:00
Oliver Blanthorn
abbdd09b70
Fix broken link to tutorial on new tab page 2018-11-23 19:48:52 +00:00
glacambre
ed6f1edb0b
src/lib/config.ts: Implement config.addChangeListener
This commit implements an addChangeListener and a removeChangeListener
function that enable tracking changes to the config in a less error
prone way, as proposed in #1180
2018-11-22 07:38:09 +01:00
Oliver Blanthorn
2a520a3b2a
Merge pull request #1187 from glacambre/singleton_types
Metadata Types: Use a single type instance where it makes sense
2018-11-21 13:06:56 +00:00
glacambre
a808e9e742
Metadata Types: Use a single type instance where it makes sense
One of the possible problems of #1184 (firefox freezing periodically
with Tridactyl enabled) is that Tridactyl uses too much RAM, which could
cause Firefox to attempt to GC it from time to time.
One easy optimisation to try to reduce this problem is to use singletons
for metadata when possible (VoidType, AnyType...).
According to my measurements, this saves the allocation of 933 objects,
which amounted to ~0.03MB. Multiply this by 40 tabs and you get about
1.20MB saved, the space of a whole 1980-era floppy disk.
2018-11-21 06:56:01 +01:00
Oliver Blanthorn
7e21d64025
Fix broken completions 2018-11-20 20:16:07 +00:00
Oliver Blanthorn
f650dfd557
Merge pull request #1186 from ntc2/master
[docs] Explain `bind` example
2018-11-20 19:48:19 +00:00
Nathan Collins
d887ddcaca [docs] Improve formatting, add example
Some of the lists were not formatted as lists and so rendered
poorly.
2018-11-20 11:23:34 -08:00
glacambre
862e2750f6
compiler/gen_metadata.ts: Kludge IndexedAccessTypes
IndexedAccessTypes are things like Class[T] in the following function
declaration:
function fn<T keyof Class>(x: T, y: Class[T])
I do not see an easy way to take this into account for now so I'm just
replacing it with Any, hopefully we'll never actually need precise
metadata for types like this.
2018-11-20 19:51:46 +01:00
Nathan Collins
033c7f7597 [docs] Explain bind example
The most complicated example in the bind docs is exactly what I was
trying to setup, but I didn't understand what it did when I first saw
it.
2018-11-20 10:45:30 -08:00
Oliver Blanthorn
f53375f474
Merge pull request #1183 from glacambre/s_buffer_tab_
Rename buffers to tabs
2018-11-19 18:27:34 +00:00
glacambre
2ed20bf47f
{excmds,config}.ts: Turn tab{first,last} into aliases
Closes #1171.
2018-11-19 18:38:33 +01:00
glacambre
c412c8dad0
Rename buffers to tabs
Note: The CSS class names are kept as they were, see #1183 for more
information.
2018-11-19 18:35:37 +01:00
Oliver Blanthorn
cda87cdb30
Merge pull request #1182 from glacambre/fix_1165
Fix 1165
2018-11-18 14:45:12 +00:00
glacambre
2ad7d4a9fb
commandline_content.ts: Fix cmdline not being inserted in non-html pages
This commit fixes the command line not appearing on
https://www.haiku-os.org/docs/HIG/index.xml. The problem was that
document.createElement uses the namespace of the current document, which
for the haiku-os page was a docbook namespace. This caused the created
iframe to have default docbook attributes and none of the regular html
ones (e.g. contentWindow).

Closes https://github.com/tridactyl/tridactyl/issues/1165 .
2018-11-18 14:28:33 +01:00
glacambre
d916d16d85
scrolling.ts: Fix Tridactyl failing to scroll on non-html pages
The reason Tridactyl was unable to scroll on
https://www.haiku-os.org/docs/HIG/index.xml is that when it tried to set
this.elem.style.scrollBehavior to "unset", an exception was thrown
because non-html elements do not have a style attribute.

This is fixed by making sure the attempt to change scrollBehavior is
only performed if the element has a style attribute.
2018-11-18 13:31:52 +01:00
Oliver Blanthorn
81edae56d2
Server is back up 2018-11-17 12:23:44 +00:00
Oliver Blanthorn
12408ce2a4
Let people know about downtime 2018-11-17 11:27:56 +00:00
Oliver Blanthorn
704e1e572d
Merge pull request #1177 from glacambre/fix_aboutpreferences_link
manifest.json: Update about:preferences link
2018-11-16 23:36:53 +00:00
glacambre
9bf5ad1cc5
Update doc links
Issue #1176 was introduced in #1026. It should have been fixed in #1157
but slipped through the cracks. It made me realize that a few other
links were broken and so I fixed them.

Closes #1176.
2018-11-16 19:52:50 +01:00
Oliver Blanthorn
70bb182107
Merge pull request #1168 from glacambre/fix_1167
commandline_frame.ts: Make sure activeCompletions is defined
2018-11-14 11:17:29 +00:00
glacambre
8d9795a19b
commandline_frame.ts: Make sure activeCompletions is defined
This is a temporary fix for
https://github.com/tridactyl/tridactyl/issues/1167 . I couldn't find
where this issue might come from and since there are no reproduction
steps this will have to do.

I plan on modeling Tridactyl in TLA+ when I have time in order to find
out where our hard-to-reproduce bugs come from. Hopefully this bug will
be among them.

Closes #1167.
2018-11-13 18:35:11 +01:00
Oliver Blanthorn
c3bdc91ba5
Merge pull request #1166 from glacambre/better_set_error_messages
UnionType.ts: Improve error message on failed conversions.
2018-11-12 18:40:54 +00:00
glacambre
dfbae7ed06
UnionType.ts: Improve error message on failed conversions.
Closes https://github.com/tridactyl/tridactyl/issues/1146.
2018-11-12 19:10:54 +01:00
Oliver Blanthorn
7c690d460a
Merge pull request #1164 from glacambre/pale3_xselpaste
Pale3 xselpaste
2018-11-10 17:10:35 +00:00
pale3
3cf0307945
xselpaste: allow primary select paste using <S-Insert>
currently it only works on web pages and not within commandline! Cos
windows platform dosn't have primary selection, execution of <S-Insert> will silently fail
2018-11-10 17:24:23 +01:00
Oliver Blanthorn
29c0449711
Merge pull request #1162 from glacambre/more_editors
native_background.ts: Add more editors
2018-11-10 11:45:20 +00:00
glacambre
2f1fdd4981
native_background.ts: Add more editors 2018-11-10 12:07:45 +01:00
Oliver Blanthorn
a679c3cf9c
Merge pull request #1157 from glacambre/fix_doc
Fix doc
2018-11-08 07:28:35 +00:00
glacambre
56fe0d9d7e
excmds.ts: Update guiset documentation links
Fixes https://github.com/tridactyl/tridactyl/issues/1104
2018-11-08 07:03:58 +01:00
glacambre
cd55b6f0f8
Update documentation links
As cmcaine said in #1149, the help page links are currently broken
because typedoc tries to generate documentation for source files in the
`compiler/` directory. I just realized that before #1026, these files
were not referenced in any of the files in the `src` directory and this
is why typedoc ignored them. This change happened because I wanted to
type the metadata.

There are three possible solution to #1149.
- Go back to untyped metadata.
- Move the metadata types to Tridactyl's src directory on build.
- Update all links to the doc.

I believe having typed metadata is useful and I'd like to keep it that
way. Moving the metadata types to Tridactyl's src directory is certainly
doable but doesn't sound like the best idea to me, we're unnecessarily
copying files. Updating the links to the doc sounds reasonable as it's
only a one-time thing and so this is what this commit does in order to
close #1149.
2018-11-08 07:00:35 +01:00
Oliver Blanthorn
2548fb07e7
Update number of beta users 2018-11-07 18:42:18 +00:00
Oliver Blanthorn
656269958d
Merge branch 'fix-1084' 2018-11-07 11:16:53 +00:00
Oliver Blanthorn
2a0f9ed1a0
Add the right version of web-ext-types 2018-11-07 11:14:17 +00:00
Oliver Blanthorn
ed581e1fa8
Merge pull request #1153 from glacambre/minor_code_cleanups
Minor code cleanups
2018-11-07 08:40:55 +00:00
Oliver Blanthorn
a48aa562c7
Merge pull request #1154 from glacambre/hide_hidden_symbols
Hide @hidden symbols
2018-11-07 08:39:50 +00:00
glacambre
ba2537cf04
Completions: do not show @hidden excmds 2018-11-07 08:39:36 +01:00
glacambre
ecc936ea7e
compiler: Add information about @hidden symbols to metadata 2018-11-07 08:12:53 +01:00