Skip to content

Instantly share code, notes, and snippets.

@take-takashi
Created February 5, 2025 00:09
Show Gist options
  • Save take-takashi/9ab8ae4b25553322c862a0e1b74dea4b to your computer and use it in GitHub Desktop.
Save take-takashi/9ab8ae4b25553322c862a0e1b74dea4b to your computer and use it in GitHub Desktop.
ブラウザ拡張のSurfingkeysの設定を自分用に記録しました。
// an example to create a new mapping `ctrl-y`
api.mapkey('<ctrl-y>', 'Show me the money', function() {
Front.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).');
});
// an example to replace `T` with `gt`, click `Default mappings` to see how `T` works.
api.map('gt', 'T');
// an example to remove mapkey `Ctrl-i`
api.unmap('<ctrl-i>');
// set theme
settings.theme = `
.sk_theme {
font-family: Input Sans Condensed, Charcoal, sans-serif;
font-size: 10pt;
background: #24272e;
color: #abb2bf;
}
.sk_theme tbody {
color: #fff;
}
.sk_theme input {
color: #d0d0d0;
}
.sk_theme .url {
color: #61afef;
}
.sk_theme .annotation {
color: #56b6c2;
}
.sk_theme .omnibar_highlight {
color: #528bff;
}
.sk_theme .omnibar_timestamp {
color: #e5c07b;
}
.sk_theme .omnibar_visitcount {
color: #98c379;
}
.sk_theme #sk_omnibarSearchResult ul li:nth-child(odd) {
background: #303030;
}
.sk_theme #sk_omnibarSearchResult ul li.focused {
background: #3e4452;
}
#sk_status, #sk_find {
font-size: 20pt;
}`;
///// カスタマイズ /////
// smooth scroll
settings.scrollStepSize = 200;
// hit a hint後に新規タブでリンクを開く
api.map('F', 'af');
// hit a hintの位置を左に変更
settings.hintAlign = "left";
// ヒストリー移動キーを変更
api.map('h', 'E') // previouasTab
api.map('l', 'R') // nextTab
// 次・前のリンクの文字列を変更
settings.nextLinkRegex = /((>>|next)|>|›|»|→|次へ|次のページ+)/i
settings.prevLinkRegex = /((<<|prev(ious)?)|<|‹|«|←|前へ|前のページ+)/i
// 参考URL
/*
https://gist.github.com/syon/3baa7ae49220c26d1753c77fe531501c
https://qiita.com/hush_in/items/653624cf5c516d3143a3
*/
// click `Save` button to make above settings to take effect.</ctrl-i></ctrl-y>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment