summaryrefslogtreecommitdiff
path: root/common/.vimfx/frame.js
diff options
context:
space:
mode:
authorSimon Parri <simonparri@ganzeria.com>2025-09-25 11:45:36 -0500
committerSimon Parri <simonparri@ganzeria.com>2025-09-25 11:45:36 -0500
commit4b83e38e03e037ab70c34ecc664e6858f3efe2d5 (patch)
treef274ee41b96a19093ffc1b7d2893ffb07c9ee502 /common/.vimfx/frame.js
parent64f157d27db9520013d451f7bf947db00c322cd3 (diff)
downloaddotfiles-4b83e38e03e037ab70c34ecc664e6858f3efe2d5.tar.gz
dotfiles-4b83e38e03e037ab70c34ecc664e6858f3efe2d5.zip
VimFX: Reimplement `goWayBack' more simply and more reliably
Diffstat (limited to 'common/.vimfx/frame.js')
-rw-r--r--common/.vimfx/frame.js13
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) => {