summaryrefslogtreecommitdiff
path: root/glide/glide.ts
blob: 9b47dc68f38d7fb8088427b10dbd04f7c60352f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Config docs:
//
//   https://glide-browser.app/config
//
// API reference:
//
//   https://glide-browser.app/api
//
// Default config files can be found here:
//
//   https://github.com/glide-browser/glide/tree/main/src/glide/browser/base/content/plugins
//
// Most default keymappings are defined here:
//
//   https://github.com/glide-browser/glide/blob/main/src/glide/browser/base/content/plugins/keymaps.mts
//
// Try typing `glide.` and see what you can do!

glide.keymaps.set("normal", "J", "tab_next");
glide.keymaps.set("normal", "K", "tab_prev");
glide.keymaps.set("normal", "H", "back");
glide.keymaps.set("normal", "L", "forward");

glide.keymaps.set("normal", "gp", async () => {
  const cur_url = new URL(glide.ctx.url).toString();
  const url = cur_url.replace("inv.nadeko.net", "youtube.com").replace(
    /watch\?.*v=([a-zA-Z0-9\-]*).*/, 'watch?v=$1'
  );
  const proc = await glide.process.spawn("mpv", [
    url
  ], { check_exit_code: false, cwd: "~"});
  console.log("openned mpv with url", url);
})

glide.prefs.set("privacy.trackingprotection.enabled", true);
glide.prefs.set("privacy.bounceTrackingProtection.mode", 1);