AtCoderで次の開催回の問題に直接移動するChromeブックマークレット作った
15405 ワード
バックアップ用に残しておく。雑なのでバグってたらすみません🐹
Chromeのサーチエンジンとして登録するとコマンドショートカットできてちょっと便利
ref: https://rawbytz.wordpress.com/2015/11/21/launch-bookmarklets-with-the-keyboard-in-chrome/
次の開催回の問題へ(abc099a -> abc100a)
javascript:(function() {
const u = window.location.href.replace(/\d+/g, a => {
const b = parseInt(a);
const c = b + 1;
return c.toString().padStart(3, '0')
});
window.open(u, '_self');
})();
前の開催回の問題へ(abc100a -> abc099a)
javascript:(function() {
const u = window.location.href.replace(/\d+/g, a => {
const b = parseInt(a);
const c = b - 1;
return c.toString().padStart(3, '0')
});
window.open(u, '_self');
})();
自分の回答ページへ飛ぶ
javascript:(function() {
const l = window.location.href.split('/')[4];
const jumpUrl = `https://atcoder.jp/contests/${l}/submissions/me`;
window.open(jumpUrl, '_blank')
})();
追記(2022/05/12)
現在の問題をVSCodeで開く(すでにパス上にファイルが存在していなければならない)
javascript:(function() {
const l = window.location.href.split('/')[4];
const arr = window.location.href.split('_');
const problem = arr[arr.length - 1].toUpperCase();
const jumpUrl = `vscode://file/Users/harukaeru/Workspace/Algorithms/${l}/${problem}/main.cpp`;
window.open(jumpUrl, '_self')
})();
Macならこのコマンドが必要。
$ defaults write com.google.Chrome URLAllowlist -array-add 'vscode://*'
参考情報:
解説を直接開く
javascript:(function() {
const l = window.location.href.split('/')[4];
const jumpUrl = `https://img.atcoder.jp/${l}/editorial.pdf`;
window.open(jumpUrl, '_blank')
})();
Author And Source
この問題について(AtCoderで次の開催回の問題に直接移動するChromeブックマークレット作った), 我々は、より多くの情報をここで見つけました https://zenn.dev/harukaeru/articles/073c3619b3169d著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Collection and Share based on the CC protocol