From 4428b1dd0f0010f1df4d9ecd9f814bdae15ba823 Mon Sep 17 00:00:00 2001 From: np-trivial <16595428+np-trivial@users.noreply.github.com> Date: Sun, 15 Nov 2020 22:05:33 -0600 Subject: [PATCH] updated bookmarklet to use URL (#47) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 729573b..da5a1cc 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Any time you're on a Github repo you can click the bookmarklet and it'll bring up the Active Forks of that repo. ```javascript -javascript:var title=document.title;if(title){ thing=title.split(':');var newPage = 'https://techgaun.github.io/active-forks/index.html#'+thing[0];open(newPage ,'targetname')} +javascript:thing=document.URL.match(/github.com\/([A-z][\w\-]*\/[A-z][\w\-]*)/);if (thing){var newPage = 'https://techgaun.github.io/active-forks/index.html#'+thing[1];open(newPage%20,'targetname')%20}%20else%20{window.alert("Not%20a%20valid%20GitHub%20page");} ``` ![Screenshot](screenshot.png "Active Forks in Action")