It seems the actual change in PR #1150 (a09a771) has been lost in its merge (6562699).
This should now actually fix Issue #1084 and ignore hidden tabs when cycling through tabs.
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.
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.
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.
[[ 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.
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.
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.
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.
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
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.
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.
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 .
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.
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.
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.
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