Skip to content

Commit 96d02c2

Browse files
authored
Fix regex
1) Escape the dot 2) Inclusive set instead of exclusion (do not match with ending `?test=lol`) Note that `\w` is equivalent to `[a-zA-Z0-9_]`. And GitHub apparently also allows `.` and `-` in the usernames and repos.
1 parent fca3fcf commit 96d02c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Once it's activated, the extension will automatically trigger itself whenever yo
6363
The online tool can be used as a [bookmarklet](https://en.wikipedia.org/wiki/Bookmarklet). To add one manually, press `Ctrl+D` to create a new bookmark and add this code in the URL field:
6464

6565
```js
66-
javascript:!function(){if(m=window.location.href.match(/github.com\/([^\/]+)\/([^\/]+)/),m){window.open(`https://useful-forks.github.io/?repo=${m[1]}/${m[2]}`)}else window.alert("Not a GitHub repo")}();
66+
javascript:!function(){if(m=window.location.href.match(/github\.com\/([\w.-]+)\/([\w.-]+)/),m){window.open(`https://useful-forks.github.io/?repo=${m[1]}/${m[2]}`)}else window.alert("Not a GitHub repo")}();
6767
```
6868

6969
When you're viewing a GitHub repo in your browser, you can press the newly created bookmarklet and this will open the online tool for the repo in a new tab.

0 commit comments

Comments
 (0)