mirror of
https://github.com/vale981/tridactyl
synced 2025-03-06 10:01:39 -05:00
make source --url use current page's url when no url is given'
This commit is contained in:
parent
49fb856523
commit
7670cc7784
1 changed files with 4 additions and 2 deletions
|
@ -726,6 +726,8 @@ export async function mktridactylrc(...args: string[]) {
|
||||||
*
|
*
|
||||||
* If no argument given, it will try to open ~/.tridactylrc, ~/.config/tridactyl/tridactylrc or $XDG_CONFIG_HOME/tridactyl/tridactylrc in reverse order. You may use a `_` in place of a leading `.` if you wish, e.g, if you use Windows.
|
* If no argument given, it will try to open ~/.tridactylrc, ~/.config/tridactyl/tridactylrc or $XDG_CONFIG_HOME/tridactyl/tridactylrc in reverse order. You may use a `_` in place of a leading `.` if you wish, e.g, if you use Windows.
|
||||||
*
|
*
|
||||||
|
* If no url is specified with the `--url` flag, the current page's URL is used to locate the RC file.
|
||||||
|
*
|
||||||
* On Windows, the `~` expands to `%USERPROFILE%`.
|
* On Windows, the `~` expands to `%USERPROFILE%`.
|
||||||
*
|
*
|
||||||
* The RC file is just a bunch of Tridactyl excmds (i.e, the stuff on this help page). Settings persist in local storage; add `sanitise tridactyllocal tridactylsync` to make it more Vim like. There's an [example file](https://raw.githubusercontent.com/cmcaine/tridactyl/master/.tridactylrc) if you want it.
|
* The RC file is just a bunch of Tridactyl excmds (i.e, the stuff on this help page). Settings persist in local storage; add `sanitise tridactyllocal tridactylsync` to make it more Vim like. There's an [example file](https://raw.githubusercontent.com/cmcaine/tridactyl/master/.tridactylrc) if you want it.
|
||||||
|
@ -736,7 +738,7 @@ export async function mktridactylrc(...args: string[]) {
|
||||||
export async function source(...args: string[]) {
|
export async function source(...args: string[]) {
|
||||||
if (args[0] === "--url") {
|
if (args[0] === "--url") {
|
||||||
let url = args[1]
|
let url = args[1]
|
||||||
if (!url) return
|
if (!url || url === "%") url = window.location.href
|
||||||
if (!(url.startsWith("http://") || url.startsWith("https://"))) url = "http://" + url
|
if (!(url.startsWith("http://") || url.startsWith("https://"))) url = "http://" + url
|
||||||
await rc.sourceFromUrl(url)
|
await rc.sourceFromUrl(url)
|
||||||
} else {
|
} else {
|
||||||
|
@ -755,7 +757,7 @@ export async function source_quiet(...args: string[]) {
|
||||||
try {
|
try {
|
||||||
if (args[0] === "--url") {
|
if (args[0] === "--url") {
|
||||||
let url = args[1]
|
let url = args[1]
|
||||||
if (!url) return
|
if (!url || url === "%") url = window.location.href
|
||||||
if (!(url.startsWith("http://") || url.startsWith("https://"))) url = "http://" + url
|
if (!(url.startsWith("http://") || url.startsWith("https://"))) url = "http://" + url
|
||||||
await rc.sourceFromUrl(url)
|
await rc.sourceFromUrl(url)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue