Skip to content

Commit 6cb30be

Browse files
authored
Merge pull request #54 from iboB/bookmarklet
Bookmarklet usage
2 parents 4e59f6e + 96d02c2 commit 6cb30be

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Sometimes, a project might be abandoned, or someone had a different idea of how
1717
* [Online tool](#online-tool)
1818
* [Chrome extension](#chrome-extension-wip) (WIP)
1919
* [`refined-github`](#refined-github)
20+
* [Bookmarklet](#bookmarklet)
2021
* [How it works](#how-it-works)
2122
* [Contributing](#contributing)
2223
* [Credits](#credits)
@@ -28,6 +29,7 @@ The project is released as:
2829
1. A website: great for people that just want to use this tool occasionally.
2930
2. A Chrome extension: has the advantage of always performing the search whenever you open a project's GitHub Forks page.
3031
3. A feature in [`refined-github`](https://github.com/sindresorhus/refined-github)
32+
4. A bookmarklet
3133

3234
### Online tool
3335
The project is [available online](https://useful-forks.github.io/) thanks to GitHub Pages.
@@ -56,6 +58,16 @@ Once it's activated, the extension will automatically trigger itself whenever yo
5658

5759
![screenshot](https://user-images.githubusercontent.com/38117856/107463541-542e8500-6b2c-11eb-8b25-082f344c1587.png)
5860

61+
### Bookmarklet
62+
63+
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:
64+
65+
```js
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")}();
67+
```
68+
69+
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.
70+
5971
## How it works
6072
![Activity_Diagram](media/query-diagram.png)
6173

0 commit comments

Comments
 (0)