diff options
author | Simon Parri <simonparri@ganzeria.com> | 2025-09-25 11:45:36 -0500 |
---|---|---|
committer | Simon Parri <simonparri@ganzeria.com> | 2025-09-25 11:45:36 -0500 |
commit | 4b83e38e03e037ab70c34ecc664e6858f3efe2d5 (patch) | |
tree | f274ee41b96a19093ffc1b7d2893ffb07c9ee502 /common | |
parent | 64f157d27db9520013d451f7bf947db00c322cd3 (diff) | |
download | dotfiles-4b83e38e03e037ab70c34ecc664e6858f3efe2d5.tar.gz dotfiles-4b83e38e03e037ab70c34ecc664e6858f3efe2d5.zip |
VimFX: Reimplement `goWayBack' more simply and more reliably
Diffstat (limited to 'common')
-rw-r--r-- | common/.vimfx/frame.js | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/common/.vimfx/frame.js b/common/.vimfx/frame.js index d06bd2b..406f1eb 100644 --- a/common/.vimfx/frame.js +++ b/common/.vimfx/frame.js @@ -1,16 +1,5 @@ vimfx.listen("goWayBack", async (_, msg) => { - try { - let eUrl = encodeURIComponent(content.location) - let aUrl = `https://archive.org/wayback/available?url=${eUrl}&closest=either&status_code=200` - let res = await content.fetch(aUrl) - if (!res.ok) return msg("Network error; failed to time travel") - let json = await res.json() - let nUrl = json?.archived_snapshots?.closest?.url - if (nUrl) - content.location = nUrl - else - msg("No URLs to travel to") - } catch { msg("Failed to time travel") } + content.location.replace("https://web.archive.org/"+content.location) }) vimfx.listen("goWayForward", (_, msg) => { |