mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 17:41:40 -05:00
Add scary messages to new tab and tutor
Trying to persuade people to update and don't have time to backport to this version.
This commit is contained in:
parent
4a5158accc
commit
10b6922e62
3 changed files with 4 additions and 163 deletions
|
@ -3,47 +3,6 @@
|
|||
import * as Messaging from "@src/lib/messaging"
|
||||
import * as config from "@src/lib/config"
|
||||
|
||||
// These functions work with the elements created by tridactyl/scripts/newtab.md.sh
|
||||
function getChangelogDiv() {
|
||||
const changelogDiv = document.getElementById("changelog")
|
||||
if (!changelogDiv) throw new Error("Couldn't find changelog element!")
|
||||
return changelogDiv
|
||||
}
|
||||
|
||||
function updateChangelogStatus() {
|
||||
const changelogDiv = getChangelogDiv()
|
||||
const changelogContent = changelogDiv.textContent
|
||||
if (localStorage.changelogContent === changelogContent) {
|
||||
const changelogButton = document.querySelector('input[id^="spoiler"]')
|
||||
if (!changelogButton) {
|
||||
console.error("Couldn't find changelog button!")
|
||||
return
|
||||
}
|
||||
changelogButton.classList.add("seen")
|
||||
}
|
||||
}
|
||||
|
||||
function readChangelog() {
|
||||
const changelogDiv = getChangelogDiv()
|
||||
localStorage.changelogContent = changelogDiv.textContent
|
||||
updateChangelogStatus()
|
||||
}
|
||||
|
||||
window.addEventListener("load", updateChangelogStatus)
|
||||
window.addEventListener("load", _ => {
|
||||
const spoilerbutton = document.getElementById("spoilerbutton")
|
||||
if (!spoilerbutton) {
|
||||
console.error("Couldn't find spoiler button!")
|
||||
return
|
||||
}
|
||||
spoilerbutton.addEventListener("click", readChangelog)
|
||||
config.getAsync("newtabfocus").then(f => {
|
||||
if (f === "page") {
|
||||
window.focus()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// Periodically nag people about updates.
|
||||
window.addEventListener("load", _ => {
|
||||
if (config.get("update", "nag") === true) {
|
||||
|
|
|
@ -1,37 +1,3 @@
|
|||
# Tridactyl tutorial
|
||||
# UPDATE TRIDACTYL NOW
|
||||
|
||||
Hello. If you've just installed Tridactyl for the first time, welcome! Tridactyl has something of a learning cliff. If you haven't used an add-on like it before, such as Pentadactyl or Vimperator, we strongly recommend you spend the 10-15 minutes it will take you to read through this tutorial. If you're already familiar with add-ons like this, we still suggest you skim through everything as there are a few things we do differently. Without further ado:
|
||||
|
||||
Welcome to the Tridactyl tutorial. Here, you will learn how to get started with this extension. If you ever want to get back to this page, just type `:tutor`.
|
||||
|
||||
It will not cover advanced topics. For those, [`:help`](../docs/modules/_src_excmds_.html) is always at hand.
|
||||
|
||||
---
|
||||
|
||||
## Basics
|
||||
|
||||
The idea behind Tridactyl is to allow you to navigate the web more efficiently with just the keyboard. Tridactyl turns Firefox into a modal browser, meaning it has several different modes of operation, like Vim. Each tab can only ever be in one mode at a time and each of these modes could have a wildly different operation. You can think of it a bit like a Transformer, if you like. There are four main modes you will want to be familiar with:
|
||||
|
||||
- Normal mode
|
||||
- This mode is used for navigating around single pages and starting other modes.
|
||||
- Tabs are usually in this mode. You can enter normal mode from the other modes by pressing `Escape`.
|
||||
- Hint mode
|
||||
- This mode highlights elements on the web page and performs actions on those elements.
|
||||
- This is most often used for following links, but it has many other submodes.
|
||||
- You can enter this mode with `f` and exit it with `Escape` or `Enter`.
|
||||
- Hint characters are displayed as uppercase letters, but you should type the lowercase letter.
|
||||
- Command mode ("ex-mode")
|
||||
- This mode allows you to execute more complicated commands by typing them out manually.
|
||||
- It is commonly used for binding keys and accessing help.
|
||||
- You can enter this mode with `:` and exit it with `Escape` or `Enter`.
|
||||
- Ignore mode
|
||||
- This mode passes all keypresses through to the web page. It is useful for websites that have their own keybinds, such as games and Gmail.
|
||||
- You can toggle the mode with `Shift-Insert` or `Ctrl-Alt-Backtick`.
|
||||
|
||||
Almost all of the modes are controlled by series of keypresses. In this tutorial, a sequence of keys such as `zz` should be entered by pressing the key `z`, letting go, and then pressing the key `z`. There is no need to hold both keys at once, if that were even possible. (`zz` resets the zoom level to the default, so it probably didn't seem to do anything). Sometimes `help` refers to a command that must be entered in command mode; it should hopefully always be clear from context which we mean.
|
||||
|
||||
---
|
||||
|
||||
## Normal mode
|
||||
|
||||
The tutorial for normal mode starts on the [next page](./2-normal_mode.html). You could try following the link by using hint mode: press `f` (if there is only a single link on the screen, it will be followed; otherwise type the characters that appear above the desired link, in lower case. They are only displayed in upper case for ease of reading).
|
||||
You are on an unsupported version of Tridactyl which has [a CRITICAL security bug](https://github.com/tridactyl/tridactyl/security/advisories/GHSA-7qr7-93pf-hr8f). [Update to version 1.16.x or downgrade to 1.14.x](https://addons.mozilla.org/en-US/firefox/addon/tridactyl-vim/versions/) as soon as possible, or stop using Tridactyl.
|
||||
|
|
|
@ -1,87 +1,3 @@
|
|||

|
||||
# UPDATE TRIDACTYL NOW
|
||||
|
||||
# Tridactyl REPLACE_ME_WITH_THE_VERSION_USING_SED
|
||||
|
||||
Tridactyl has to override your new tab page due to WebExtension limitations. You can learn how to change it at the bottom of the page, otherwise please read on for some tips and tricks.
|
||||
|
||||
- You can view the main help page by typing [`:help`][help], and access the tutorial with [`:tutor`][tutor].
|
||||
|
||||
- You can view your current configuration with `:viewconfig`.
|
||||
|
||||
- Upcoming **userChrome.css** changes: Mozilla is going to require a preference to be set to true from Firefox 68 to read userChrome. See [this issue](https://github.com/tridactyl/tridactyl/issues/1572).
|
||||
|
||||
- **Tridactyl retreat** 👀: 4 of the core Tridactyl developers are meeting up in the real world to work on Tridactyl from 24th May - 1st June in the Peak District, UK in late May. [Donate using this link](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7JQHV4N2YZCTY) if you'd like to contribute to our travel, accommodation and subsistence costs, which we estimate will be about £2,000. As of May 22nd, we have so far raised ~£680, so thanks to all of you who have donated. If you have any suggestions for things we should especially focus on, please comment on [this issue](https://github.com/tridactyl/tridactyl/issues/1379).
|
||||
|
||||
- If Tridactyl breaks a website or is broken by a website, trying the steps in the [troubleshooting guide](https://github.com/tridactyl/tridactyl/blob/master/doc/troubleshooting.md) might help.
|
||||
|
||||
- You can contact the developers, other users and contributors for support or whatever on [Matrix][matrix-link], [Gitter][gitter-link], or [IRC][freenode-link].
|
||||
|
||||
- If you're enjoying Tridactyl (or not), please leave a review on [addons.mozilla.org][amo].
|
||||
|
||||
REPLACE_ME_WITH_THE_CHANGE_LOG_USING_SED
|
||||
|
||||
## Highlighted features:
|
||||
|
||||
- `f`/`F` — enter the "hint mode" to select a link to follow. `F` to open it in a background tab. (Note: hint characters should be typed in lowercase.)
|
||||
- `Shift` + `Insert` — enter "ignore mode" to send all key presses to the web page you are on. Press `Shift` + `Insert` again to return to the highly productive "normal mode".
|
||||
- `H`/`L` — go back/forward in the history.
|
||||
- `o`/`O` — open a URL in this tab (`O` to pre-load current URL).
|
||||
- `t`/`T` — open a URL in a new tab (`T` to pre-load current URL).
|
||||
- `gt`/`gT` — go to the next/previous tab.
|
||||
- `d` — close the current tab.
|
||||
- `/` — open the find search box. Use <kbd>ctrl</kbd> + g/G to cycle through search results.
|
||||
- `A` — bookmark the current page
|
||||
- `b` — bring up a list of open tabs in the current window.
|
||||
- `s` — if you want to search for something that looks like a domain name or URL.
|
||||
- `gi` — scroll to and focus the last-used input on the page.
|
||||
- `gr` — open Firefox reader mode (note: Tridactyl will not work in this mode).
|
||||
- Bind your own commands with, e.g., `:bind J tabprev`. Type `:help bind` to see help on custom binds.
|
||||
- `yy` — copy the current page URL to your clipboard.
|
||||
- `[[`/`]]` — navigate forward/backward though paginated pages.
|
||||
- `ZZ` — close all tabs and windows, but it will only "save" them if your about:preferences are set to "show your tabs and windows from last time".
|
||||
- [`:help hint`][help-hint] to see all the other useful hint modes (this is the `f` magic. :) ).
|
||||
- `:help <keybinding>` to learn more about what a specific key binding does.
|
||||
|
||||
## Important limitations due to WebExtensions
|
||||
|
||||
- You can only navigate to most about: and file: pages if you have Tridactyl's native executable installed.
|
||||
- Firefox will not load Tridactyl on about:\*, some file:\* URIs, view-source:\*, or data:\*. On these pages Ctrl-L (or F6), Ctrl-Tab and Ctrl-W are your escape hatches.
|
||||
- You can change the Firefox GUI with `guiset` (e.g. `guiset gui none` and then `restart`) if you have the native messenger installed, or you can do it yourself by changing your userChrome.
|
||||
- Tridactyl cannot capture key presses until web pages are loaded. You can use `:reloadall` to reload all tabs to make life more bearable, or flip `browser.sessionstore.restore_tabs_lazily` to false in `about:config`.
|
||||
|
||||
## Why do I see this here?
|
||||
|
||||
Tridactyl overrides your newtab page because it cannot insert its content script on the default about:newtab. Without the content script, our shortcuts won't work, even if you're just passing through the page. We're working with Firefox on improvements to the WebExtension APIs that will remove this restriction.
|
||||
|
||||
### How can I get rid of it?
|
||||
|
||||
- `:set newtab [URL]`
|
||||
- e.g, `:set newtab about:blank`
|
||||
|
||||
Also, if you want to use a new tab page provided by another extension, make sure to install said extension after Tridactyl. Uninstalling and re-installing the other extension should work too.
|
||||
|
||||
Alternatively, if you don't need Tridactyl to work on the new tab page, you can install the beta build without new tab page. You can get it [here][nonewtablink]. To migrate your configuration across builds, see [this comment][migratelink].
|
||||
|
||||
## FAQ
|
||||
|
||||
You have more questions? Have a look at our [FAQ][faq-link].
|
||||
|
||||
[1]: https://github.com/tridactyl/tridactyl/issues
|
||||
|
||||
<div class="align-left">
|
||||
[1]: https://github.com/tridactyl/tridactyl/issues<br />
|
||||
</div>
|
||||
|
||||
[faq-link]: https://github.com/tridactyl/tridactyl#frequently-asked-questions
|
||||
[help]: /static/docs/modules/_src_excmds_.html
|
||||
[tutor]: /static/clippy/1-tutor.html
|
||||
[help-hint]: /static/docs/modules/_src_excmds_.html#hint
|
||||
[gitter-badge]: /static/badges/gitter-badge.svg
|
||||
[gitter-link]: https://gitter.im/tridactyl/Lobby
|
||||
[freenode-badge]: /static/badges/freenode-badge.svg
|
||||
[freenode-link]: ircs://chat.freenode.net/tridactyl
|
||||
[matrix-badge]: https://matrix.to/img/matrix-badge.svg
|
||||
[matrix-link]: https://riot.im/app/#/room/#tridactyl:matrix.org
|
||||
[amo]: https://addons.mozilla.org/en-US/firefox/addon/tridactyl-vim/reviews/
|
||||
[nonewtablink]: https://tridactyl.cmcaine.co.uk/betas/nonewtab/tridactyl_no_new_tab_beta-latest.xpi
|
||||
[migratelink]: https://github.com/tridactyl/tridactyl/issues/79#issuecomment-351132451
|
||||
You are on an unsupported version of Tridactyl which has [a CRITICAL security bug](https://github.com/tridactyl/tridactyl/security/advisories/GHSA-7qr7-93pf-hr8f). [Update to version 1.16.x or downgrade to 1.14.x](https://addons.mozilla.org/en-US/firefox/addon/tridactyl-vim/versions/) as soon as possible, or stop using Tridactyl.
|
||||
|
|
Loading…
Add table
Reference in a new issue