Skip to content

Commit fb730bc

Browse files
authored
Update README Bookmarklet (conwnet#173)
* Update README.md Update Bookmarklet in README. Make the URL recoverable to github.com. * Update README Bookmarklet Update Bookmarklet in README. You can use it to quickly switch between github.com and github1s.com.
1 parent c4886ef commit fb730bc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ For example, try it on the VS Code repo:
1616

1717
For browser extensions, see [Third-party Related Projects](https://github.com/conwnet/github1s#third-party-related-projects).
1818

19-
Or save the following code snippet as a bookmarklet (GitHub markdown doesn't allow js links, so just copy it into a bookmark).
19+
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).
2020

2121
```
22-
javascript: window.location.href = window.location.href.replace('github.com', 'github1s.com')
22+
javascript: window.location.href = window.location.href.replace(/github(1s)?.com/, function(match, p1) { return p1 ? 'github.com' : 'github1s.com' })
2323
```
2424

2525
## Documentation

0 commit comments

Comments
 (0)