Skip to content

Commit

Permalink
Merge branch 'master' of github.com:cmcaine/tridactyl into container-…
Browse files Browse the repository at this point in the history
…aucmds
  • Loading branch information
bovine3dom committed Jul 30, 2018
2 parents 7639a6f + 3f64853 commit ab94d9d
Show file tree
Hide file tree
Showing 42 changed files with 1,087 additions and 633 deletions.
16 changes: 12 additions & 4 deletions .tridactylrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
" bovine3dom's dogfood
"

" Provided only as an example.
" Do not install/run without reading through as you may be surprised by some
" of the settings.

" May require the latest beta builds.

" Move this to $XDG_CONFIG_DIR/tridactyl/tridactylrc (that's
" ~/.config/tridactyl/tridactylrc to mere mortals) or ~/.tridactylrc and
Expand All @@ -18,6 +23,9 @@
" Comment toggler for Reddit and Hacker News
bind ;c hint -c [class*="expand"],[class="togg"]

" GitHub pull request checkout command to clipboard (only works if you're a collaborator or above)
bind yp composite js document.getElementById("clone-help-step-1").textContent.replace("git checkout -b", "git checkout -B").replace("git pull ", "git fetch ") + "git reset --hard " + document.getElementById("clone-help-step-1").textContent.split(" ")[3].replace("-","/") | yank

"
" Misc settings
"
Expand All @@ -34,7 +42,7 @@ set hintchars 4327895610

" Make Tridactyl work on more sites at the expense of some security
set csp clobber
fixamo
fixamo_quiet

" Make quickmarks for the sane Tridactyl issue view
quickmark t https://github.com/cmcaine/tridactyl/issues?utf8=%E2%9C%93&q=sort%3Aupdated-desc+
Expand All @@ -44,9 +52,9 @@ quickmark t https://github.com/cmcaine/tridactyl/issues?utf8=%E2%9C%93&q=sort%3A
"

" New reddit is bad
autocmd DocStart www.reddit.com urlmodify -t www old
autocmd DocStart www.reddit.com js tri.excmds.urlmodify("-t www old")
" Mosquito nets won't make themselves
autocmd DocStart www.amazon.co.uk urlmodify -t www smile
autocmd DocStart www.amazon.co.uk js tri.excmds.urlmodify("-t www smile")

" This will have to do until someone writes us a nice syntax file :)
" vim: set filetype=vim:
85 changes: 85 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,90 @@
# Tridactyl changelog

## Release 1.13.2 / Unreleased

* New features:

* Rapid hinting bound to `gF`. One of our most requested features.

* Add `DocLoad` autocmd which triggers after all HTML is downloaded (it fires on DOMContentLoaded).

* All clipboard commands on Linux now support X-selection if you have the native messenger installed. Simply set `yankto` and `putfrom` to `selection`.

* Add private window indicator to `bufferall`; add container icons to `buffer{,all}`.

* Add `fillcmdline_tmp`, useful for temporary messages. A few commands now use this (e.g, `yy`).

* `tabmove` bound to `<<` and `>>` à la Vimium.

* Add `mute` to mute tabs. Bound to `<A-m>` by default.

* Add `<A-p>` bind for `pin`.

* Add `{fixamo,guiset}_quiet` for non-interactive use; normal `{fixamo,guiset}` now inform you that you must restart.

* Add `url2args` ex-command to retrieve search terms from Tridactyl search engines, for use with `O`. `help url2args` for more information.

* Add `autocmddelete` to delete an autocmd.

* Add binds for yankmd and yanktitle to `yt` and `ym` irrespectively.

* Our GitHub has a new troublehooting guide and issue template (#522).

* Bug fixes:

* Fix race condition in state.mode synchronization (#613).

* `set newtab about:blank` should work once again (#678).

* Make `tabprev` synchronous: it now works better in `composite` commands (i.e, `D` is less janky).

* Fix `guiset hoverlink *` in Firefox 61 (#763).

* Make `source` ignore visually empty lines.

* Completions will now be properly deselected upon typing (#833).

* `guiset` now gives helpful errors if given the wrong arguments (#844).

* History completion insertion with space no longer inserts an extra space (#838).

* Ctrl-y actually scrolls up now

* Arguments now ignored on history completions (`-private, -c, -b` etc.).

* Native messenger:

* Windows install script now complains if you do not have the requisite PowerShell version.

* Windows install script should now work if you have a non-ASCII username/directory

* Windows install script no longer rage-quits if Python is not found.
* This means that the compiled executable will actually be used. It's much slower than the normal Python script, so we strongly recommend that you use that instead by installing Python 3, making sure it is on your PATH, and running `installnative` again.

* Fix focus hijacking again (#768).

* Fix scrolling on bugzilla.mozilla.org (#762).

* Fix race condition in :sanitise (#724).

* Make sure bind/unbind use the same binding format: previously, modifiers on binds were case-sensitive for some commands.

* Container commands are now more case-insensitive.

* Fix jumplist not being correctly restored on reloads (#680).

* Update 1.13.1 release date in time for 1.13.2

* Boring internal stuff

* Move most of hinting to content script (this may have broken some stuff - please report it if it has).

Thanks to all of our contributors for this release: Oliver Blanthorn, glacambre, Anton Vilhelm Ásgeirsson, Babil Golam Sarwar, Jeff King, Bzly, WorldCodeCentral, Colin Caine, Vladimir Macko, Bodo Graumann, Chris Pickard, Matt Friedman, Susexe, jcrowgey.

Extra special thanks go to Chris Pickard, Matt Friedman, Susexe, Vladimir Macko, WorldCodeCentral, all of whom were first time contributors!

And thanks to anyone who reported issues.

## Release 1.13.1 / 2018-06-20

* New features
Expand Down
43 changes: 43 additions & 0 deletions doc/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Settings that can fix websites

If changing one of these settings fixes your bug, please visit the corresponding Github issue and let us know you encountered the bug.

* `:set noiframeon $URL_OF_THE_WEBSITE` and then reload the page. This disables the Tridactyl commandline on a specific url. [CREATE CORRESPONDING ISSUE]
* `:set allowautofocus true` and then reload the page. This allows website to use the javascript `focus()` function. [#550](https://github.com/cmcaine/tridactyl/issues/550)
* `:set modeindicator false` and then reload the page. This disables the mode indicator. [#821](https://github.com/cmcaine/tridactyl/issues/821)
* `:get csp`. If the value returned is "untouched", try `:set csp clobber`. If the value is "clobber", try `:set csp untouched`. In both cases, please reload the page. This disables (or prevents disabling) some security settings of the page. [#109](https://github.com/cmcaine/tridactyl/issues/109)

# Native Editor/Messenger issues

If you're having trouble running your editor on OSX, you might be having $PATH issues: [#684](https://github.com/cmcaine/tridactyl/issues/684). The solution is to specify the absolute path to your editor, like this: `:set editorcmd /usr/local/bin/vimr`.

If you're encountering problems on windows, you might want to try some of the workarounds mentioned here: [#797](https://github.com/cmcaine/tridactyl/issues/797).

# Getting logging information

Tridactyl can selectively display logs for certain components. These components are the following:

* messaging
* cmdline
* controller
* containers
* hinting
* state
* styling
* excmds

In order to activate logging for a component, you can use the following command: `:set logging.$COMPONENT DEBUG`. Then, to get the logs, click the hamburger menu in the top right of Firefox, click "Web Developer", then click "Browser Console". Open the menu again and click "Web Console" in the same place.

This will open a two consoles where Tridactyl's messages are logged. Click on the little bin icons in the consoles in order to remove previous messages and try to re-trigger the bug. Copy the logs as you would any other text, and then paste them in your GitHub issue in a block surrounded by three backticks like so:

```
\`\`\`
logs
go
here
\`\`\`
```

Unfortunately, Firefox truncates some objects, so if there are any that look particularly important, please copy them manually by right clicking on them and clicking "Copy object".

Once you have finished troubleshooting, we recommend that you run `unset logging` as the logs can slow Tridactyl down a bit.
41 changes: 41 additions & 0 deletions issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!--
Thanks for taking the time to file an issue. If you're short on time, please just delete all of this and file your issue. Otherwise, read on : )
# Making a feature request
Please search our `:help` page and through the other issues on this repository; then, delete all of this text and describe your feature.
# Reporting a bug / getting help
If you're opening this issue to report a bug with a specific site, please read and follow the "Settings that can fix websites" paragraph of the (troubleshooting steps)[https://github.com/cmcaine/tridactyl/tree/master/doc/troubleshooting.md] first.
If that does not solve your problem, please fill in the following template and then delete all the lines above it, and any other lines which you do not feel are applicable:
-->

* Brief description of the problem:

* Steps to reproduce:

1. 2. 3. 4. 5.

* Tridactyl version (`:version`):

* Firefox version (Top right menu > Help > About Firefox):

* URL of the website the bug happens on:

* Config (in a new tab, run `:viewconfig`, copy the url and paste it somewhere like gist.github.com):

* Contents of ~/.tridactylrc or ~/.config/tridactyl/tridactylrc (if they exist):

```
Insert tridactylrc contents between the backticks
```

<!-- If your bug is about Tridactyl's native executable, please add the following information: -->

* Operating system:
* Result of running `:! echo $PATH` in tridactyl:
* Unix-like only: result of running `printf '%c\0\0\0{"cmd": "run", "command": "echo $PATH"}' 39 | ~/.local/share/tridactyl/native_main.py` in a terminal:
17 changes: 8 additions & 9 deletions native/native_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import unicodedata

DEBUG = False
VERSION = "0.1.6"
VERSION = "0.1.7"


class NoConnectionError(Exception):
Expand Down Expand Up @@ -380,7 +380,7 @@ def write_log(msg):
debug_log_dirname = ".tridactyl"
debug_log_filename = "native_main.log"

debug_log_path = "%s\\%s\\%s" % (
debug_log_path = os.path.join(
os.path.expanduser("~"),
debug_log_dirname,
debug_log_filename,
Expand Down Expand Up @@ -413,15 +413,14 @@ def handleMessage(message):

elif cmd == "run":
commands = message["command"]
stdin = message.get("content", "").encode("utf-8")

try:
p = subprocess.check_output(commands, shell=True)
reply["content"] = p.decode("utf-8")
reply["code"] = 0
p = subprocess.Popen(commands, shell=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE)

except subprocess.CalledProcessError as process:
reply["code"] = process.returncode
reply["content"] = process.output.decode("utf-8")
reply["content"] = p.communicate(stdin)[0].decode("utf-8")
reply["code"] = p.returncode

elif cmd == "eval":
output = eval(message["command"])
Expand Down
36 changes: 34 additions & 2 deletions native/win_install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ $global:MessengerManifestFilename = "tridactyl.json"
$global:PythonVersionStr = "^3\."
$global:WinPython3Command = "py -3 -u"
$global:MessengerManifestReplaceStr = "REPLACE_ME_WITH_SED"
$global:PowerShellMinimumVersion = 3

# $git_repo_owner should be "cmcaine" in final release
$git_repo_owner = "cmcaine"
Expand Down Expand Up @@ -43,6 +44,30 @@ $global:NoPython= $NoPython
$global:InstallDirBase = $InstallDirBase.Trim()
$global:DebugDirBase = $DebugDirBase.Trim()

function Set-PowerShellVersion() {
$requiredPowerShellVersion = $global:PowerShellMinimumVersion
$currentPowerShellVersion = [int]`
($PSVersionTable.PSVersion.Major)

if ($currentPowerShellVersion -lt $requiredPowerShellVersion) {
$msg = [string]::Format("{0} >= '{1}' {2}, '{3}' {4}",
" - PowerShell major version",
$requiredPowerShellVersion,
"required",
$currentPowerShellVersion,
"found, quitting ..."
)

Write-Host "[+] Installation failed. :-("
Write-Host $msg
exit -1
}
}
function Set-TlsVersion() {
[Net.ServicePointManager]::SecurityProtocol =
[Net.SecurityProtocolType]::Tls12 -bOr `
[Net.SecurityProtocolType]::Tls11
}
function Get-PythonVersionStatus() {
try {
$pythonVersion = Invoke-Expression `
Expand Down Expand Up @@ -231,10 +256,15 @@ function Set-MessengerBin() {
Write-Host "[+] Downloading $messengerBinUri ..."

try {
Set-TlsVersion
Invoke-WebRequest `
-Uri $messengerBinUri `
-OutFile $messengerBinPath
} catch {
Write-Host `
"Invoke-WebRequest Exception:" `
$_.Exception.GetType().FullName, $_.Exception.Message

Write-Host `
"Invoke-WebRequest StatusCode:" `
$_.Exception.Response.StatusCode.value__
Expand Down Expand Up @@ -352,6 +382,7 @@ function Set-MessengerManifest() {
Write-Host "[+] Downloading $messengerManifestUri ..."

try {
Set-TlsVersion
Invoke-WebRequest `
-Uri $messengerManifestUri `
-OutFile $messengerManifestPath
Expand Down Expand Up @@ -495,8 +526,8 @@ function Set-MessengerInstall() {
Write-Host " - Python 3 not found, will use EXE ..."
$global:NoPython = $true
} else {
$pythonPath = Get-Command "py" `
| Select-Object -ExpandProperty "Source"
$pythonPath = Get-Command "py" `
| Select-Object -ExpandProperty "Source"

Write-Host " - Python 3 found at: $pythonPath"
}
Expand Down Expand Up @@ -554,4 +585,5 @@ if ($global:Uninstall) {
exit 0
}

Set-PowerShellVersion
Set-MessengerInstall

0 comments on commit ab94d9d

Please sign in to comment.