From 8cfba430ef0f9324577e795d69fef61560684bb8 Mon Sep 17 00:00:00 2001 From: shanyuhai123 <864299347@qq.com> Date: Tue, 23 Feb 2021 23:40:08 +0800 Subject: [PATCH 1/2] Update README.md Update Bookmarklet in README. Make the URL recoverable to github.com. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fcf18bb6f..2daac49d2 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ For browser extensions, see [Third-party Related Projects](https://github.com/co Or save the following code snippet as a bookmarklet (GitHub markdown doesn't allow js links, so just copy it into a bookmark). ``` -javascript: window.location.href = window.location.href.replace('github.com', 'github1s.com') +javascript: window.location.href = window.location.href.replace(/github(1s)?.com/, function(match, p1) { return p1 ? 'github.com' : 'github1s.com' }) ``` ## Documentation From 6a9c56a544de669febdbd9ab3b90207f7375dfe7 Mon Sep 17 00:00:00 2001 From: shanyuhai123 <864299347@qq.com> Date: Wed, 24 Feb 2021 09:47:52 +0800 Subject: [PATCH 2/2] Update README Bookmarklet Update Bookmarklet in README. You can use it to quickly switch between github.com and github1s.com. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2daac49d2..52a49855e 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ For example, try it on the VS Code repo: For browser extensions, see [Third-party Related Projects](https://github.com/conwnet/github1s#third-party-related-projects). -Or save the following code snippet as a bookmarklet (GitHub markdown doesn't allow js links, so just copy it into a bookmark). +Or save the following code snippet as a bookmarklet, you can use it to quickly switch between github.com and github1s.com (GitHub markdown doesn't allow js links, so just copy it into a bookmark). ``` javascript: window.location.href = window.location.href.replace(/github(1s)?.com/, function(match, p1) { return p1 ? 'github.com' : 'github1s.com' })